mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed token validation endpoint for Listenbrainz
This commit is contained in:
parent
ddbdc7ec56
commit
bdfb2a4a0b
@ -5,7 +5,7 @@ author = {
|
||||
"email":"maloja@krateng.dev",
|
||||
"github": "krateng"
|
||||
}
|
||||
version = 2,6,7
|
||||
version = 2,6,8
|
||||
versionstr = ".".join(str(n) for n in version)
|
||||
links = {
|
||||
"pypi":"malojaserver",
|
||||
|
@ -212,10 +212,10 @@ class LBrnz1(APIHandler):
|
||||
|
||||
def validate_token(self,pathnodes,keys):
|
||||
try:
|
||||
token = keys.get("Authorization").replace("token ","").replace("Token ","").strip()
|
||||
token = keys.get("token").strip()
|
||||
except:
|
||||
raise BadAuthException()
|
||||
if token not in database.allAPIkeys():
|
||||
raise InvalidAuthException()
|
||||
else:
|
||||
return 200,{"code":200,"message":"Token valid.",valid:True}
|
||||
return 200,{"code":200,"message":"Token valid.","valid":True,"user_name":"n/a"}
|
||||
|
@ -3,3 +3,4 @@
|
||||
|
||||
replaceartist SING女團 S.I.N.G.
|
||||
replacetitle SING-Moonlight Thoughts Moonlight Thoughts (English Version)
|
||||
replacetitle 那不勒斯的黎明 Dawn in Naples
|
||||
|
Can't render this file because it has a wrong number of fields in line 4.
|
Loading…
Reference in New Issue
Block a user