feat: read username if email is not available for oauth provider

Also add recipe for OAuth with GitHub setup
This commit is contained in:
2024-01-05 12:28:31 +02:00
parent 9510a14b90
commit 56e97040d6
7 changed files with 115 additions and 1 deletions

View File

@ -130,7 +130,7 @@ class OAuth(Mapping):
client.access_token = access_token
user, _ = await client.user_info()
username: str = user.email # type: ignore[attr-defined]
username: str = user.email or user.username # type: ignore[attr-defined]
return username
except Exception:
self.logger.exception("got exception while performing request")