diff options
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 |