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",
|
"email":"maloja@krateng.dev",
|
||||||
"github": "krateng"
|
"github": "krateng"
|
||||||
}
|
}
|
||||||
version = 2,6,7
|
version = 2,6,8
|
||||||
versionstr = ".".join(str(n) for n in version)
|
versionstr = ".".join(str(n) for n in version)
|
||||||
links = {
|
links = {
|
||||||
"pypi":"malojaserver",
|
"pypi":"malojaserver",
|
||||||
|
|
|
@ -212,10 +212,10 @@ class LBrnz1(APIHandler):
|
||||||
|
|
||||||
def validate_token(self,pathnodes,keys):
|
def validate_token(self,pathnodes,keys):
|
||||||
try:
|
try:
|
||||||
token = keys.get("Authorization").replace("token ","").replace("Token ","").strip()
|
token = keys.get("token").strip()
|
||||||
except:
|
except:
|
||||||
raise BadAuthException()
|
raise BadAuthException()
|
||||||
if token not in database.allAPIkeys():
|
if token not in database.allAPIkeys():
|
||||||
raise InvalidAuthException()
|
raise InvalidAuthException()
|
||||||
else:
|
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.
|
replaceartist SING女團 S.I.N.G.
|
||||||
replacetitle SING-Moonlight Thoughts Moonlight Thoughts (English Version)
|
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