fix invalid auth response
This commit is contained in:
parent
94184f8635
commit
cf9aad9aee
@ -70,7 +70,7 @@ def protected(wrapped):
|
|||||||
@validate(json=LoginRequest)
|
@validate(json=LoginRequest)
|
||||||
async def login(_, body: LoginRequest):
|
async def login(_, body: LoginRequest):
|
||||||
if not pbkdf2_sha256(10000, salt=b'salt').verify(body.password, api_auth.get(body.username)):
|
if not pbkdf2_sha256(10000, salt=b'salt').verify(body.password, api_auth.get(body.username)):
|
||||||
return {'status': 'error', 'message': 'Invalid username or password'}
|
return jsonr({'status': 'error', 'message': 'Invalid username or password'})
|
||||||
return jsonr({
|
return jsonr({
|
||||||
'token': jwt.encode({}, api_secret, algorithm='HS256'),
|
'token': jwt.encode({}, api_secret, algorithm='HS256'),
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user