Load flask principal permissions even for web and api endpoints.
This commit is contained in:
parent
23cbcb2979
commit
9278871381
6 changed files with 33 additions and 15 deletions
|
@ -50,6 +50,10 @@ def verify_token(code, namespace_name, repository_name):
|
|||
return None
|
||||
|
||||
|
||||
def get_token(code):
|
||||
return AccessToken.get(AccessToken.code == code)
|
||||
|
||||
|
||||
def change_password(user, new_password):
|
||||
pw_hash = bcrypt.hashpw(new_password, bcrypt.gensalt())
|
||||
user.password_hash = pw_hash
|
||||
|
|
Reference in a new issue