diff options
author | Frederick Muriuki Muriithi | 2022-12-19 16:00:37 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-12-21 06:13:41 +0300 |
commit | e9031e28594fcd21371adb2b9b26e17a1df95599 (patch) | |
tree | c53e180055047b667d6359278dc95f50836a4e9a | |
parent | 2a5d5ef7c0feab84cc3cd5d78f40e70050a49c00 (diff) | |
download | genenetwork3-e9031e28594fcd21371adb2b9b26e17a1df95599.tar.gz |
auth: oauth2: users: Add expected property
* gn3/auth/authentication/users.py: authlib expects the user object to have a
`get_user_id` method.
-rw-r--r-- | gn3/auth/authentication/users.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gn3/auth/authentication/users.py b/gn3/auth/authentication/users.py index 4adee61..11deba2 100644 --- a/gn3/auth/authentication/users.py +++ b/gn3/auth/authentication/users.py @@ -12,6 +12,10 @@ class User(NamedTuple): email: str name: str + def get_user_id(self): + """Return the user's UUID. Mostly for use with Authlib.""" + return self.user_id + def user_by_email(conn: db.DbConnection, email: str) -> Maybe: with db.cursor(conn) as cursor: cursor.execute("SELECT * FROM users WHERE email=?", (email,)) |