mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
refactor(tokens-repo): delete get token name from auth utils
This commit is contained in:
parent
25326b75ca
commit
87ea88c50a
|
@ -73,15 +73,6 @@ def is_token_valid(token):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def get_token_name(token: str) -> typing.Optional[str]:
|
|
||||||
"""Return the name of the token provided"""
|
|
||||||
with ReadUserData(UserDataFiles.TOKENS) as tokens:
|
|
||||||
for t in tokens["tokens"]:
|
|
||||||
if t["token"] == token:
|
|
||||||
return t["name"]
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
class BasicTokenInfo(BaseModel):
|
class BasicTokenInfo(BaseModel):
|
||||||
"""Token info"""
|
"""Token info"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue