diff options
author | Parker <contact@pkrm.dev> | 2024-02-26 20:55:05 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-02-26 20:55:05 -0600 |
commit | bce756b9aa51dfdfa2c2e6cdef4f88f660b80148 (patch) | |
tree | d2e7a238b04d4339bedf05f626bff15d48a61945 /app/auth.py | |
parent | a0bfa5440603841c40e6a29495ca49c09a5d8c83 (diff) |
Overhaul: Flask -> FastAPI
Diffstat (limited to 'app/auth.py')
-rw-r--r-- | app/auth.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/app/auth.py b/app/auth.py deleted file mode 100644 index aa278f2..0000000 --- a/app/auth.py +++ /dev/null @@ -1,16 +0,0 @@ -from flask_httpauth import HTTPTokenAuth -import sqlalchemy - -from db import engine - - -auth = HTTPTokenAuth(scheme='Bearer') - -@auth.verify_token -def verify_token(token): - try: - with engine.begin() as conn: - token = conn.execute(sqlalchemy.text('SELECT * FROM accounts WHERE api_key = :api_key'), [{'api_key': token}]).fetchone() - return token[0] - except TypeError: - return False
\ No newline at end of file |