Initial Commit

This commit is contained in:
2023-09-08 19:05:37 +03:00
commit 7e60195cb7
185 changed files with 27107 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
from flask_httpauth import HTTPBasicAuth
auth = HTTPBasicAuth()
@auth.verify_password
def verify_password(username_or_token, password):
if username_or_token == "user" and password == "passwd":
return True
return False
def post_login_required(func):
def post_decorator(*args, **kwargs):
print("post_decorator ", func, *args, **kwargs)
return auth.login_required(func)(*args, **kwargs)
if func.__name__ in ("post", "patch", "delete"):
return post_decorator
return func