mirror of
https://github.com/catspace-dev/unicheckbot.git
synced 2025-11-08 11:27:29 +03:00
14 lines
348 B
Python
14 lines
348 B
Python
from functools import wraps
|
|
from flask import request, abort
|
|
from config import ACCESS_TOKEN
|
|
|
|
|
|
def access_token_required(f):
|
|
@wraps(f)
|
|
def decorated(*args, **kwargs):
|
|
if token := request.args.get('token', None):
|
|
if token == ACCESS_TOKEN:
|
|
return f(*args, **kwargs)
|
|
abort(403)
|
|
return decorated
|