mirror of
https://github.com/kevin-DL/ShortMe-URL-Shortener.git
synced 2026-01-12 03:15:17 +00:00
Initial commit
This commit is contained in:
12
app/server/api/api_auth.py
Normal file
12
app/server/api/api_auth.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from flask_httpauth import HTTPTokenAuth
|
||||
|
||||
from app.server.db.models import AuthToken
|
||||
|
||||
auth = HTTPTokenAuth(scheme='Bearer')
|
||||
|
||||
|
||||
@auth.verify_token
|
||||
def verify_token(token):
|
||||
"""Used to verify user's Token"""
|
||||
return AuthToken.query.filter_by(auth_token=token).first()
|
||||
|
||||
Reference in New Issue
Block a user