Skip to content

Commit edc1d70

Browse files
committed
get data from userinfo
1 parent 13c36e6 commit edc1d70

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/bornhack_allauth_provider/provider.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def extract_common_fields(self, data: dict[str, str]) -> dict[str, str]:
2323
"""Map OIDC user claims to the data dict used in BornHackSocialAccountAdapter.populate_user()."""
2424
return {
2525
# standard OIDC user claims
26-
"username": str(data["sub"]),
27-
"handle": str(data.get("preferred_username", "")),
26+
"username": str(data["userinfo"]["sub"]),
27+
"handle": str(data["userinfo"].get("preferred_username", "")),
2828
# custom BornHack user claims
29-
"description": str(data.get("bornhack:v2:description", "")),
30-
"public_credit_name": str(data.get("bornhack:v2:public_credit_name", "BMA user")),
29+
"description": str(data["userinfo"].get("bornhack:v2:description", "")),
30+
"public_credit_name": str(data["userinfo"].get("bornhack:v2:public_credit_name", "BMA user")),
3131
}
3232

3333

0 commit comments

Comments
 (0)