|
|
@ -16,7 +16,9 @@ def login(): |
|
|
|
username = rdata['username'] |
|
|
|
password = rdata['password'] |
|
|
|
if dao.valid(username, password): |
|
|
|
return make_response(json.dumps({'result': 'success'})).set_cookie('jwt', jwt.generate_jwt(username)) |
|
|
|
response = make_response(json.dumps({'result': 'success'})) |
|
|
|
response.set_cookie('jwt', jwt.generate_jwt(username)) |
|
|
|
return response |
|
|
|
else: |
|
|
|
return make_response(json.dumps({'result': 'fail'})) |
|
|
|
|
|
|
|