Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
875301b437
|
|||
da06065959
|
|||
fe007cbfe7
|
@ -39,7 +39,7 @@ try:
|
|||||||
|
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
cur.execute("""
|
cur.execute("""
|
||||||
INSERT INTO users (login, password)
|
INSERT INTO users (login, pwhash)
|
||||||
VALUES(?, ?)
|
VALUES(?, ?)
|
||||||
""", [user, pwhash])
|
""", [user, pwhash])
|
||||||
cur.execute("""
|
cur.execute("""
|
||||||
|
2
auth.py
2
auth.py
@ -103,7 +103,7 @@ def generateToken(**args):
|
|||||||
# print("DEBUG: generateToken: add claim {} -> {}".format(claim[0], claim[1]))
|
# print("DEBUG: generateToken: add claim {} -> {}".format(claim[0], claim[1]))
|
||||||
payload["x-{}".format(claim[0])] = claim[1]
|
payload["x-{}".format(claim[0])] = claim[1]
|
||||||
|
|
||||||
return jwt.encode(payload, JWT_ISSUER)
|
return jwt.encode(payload, JWT_SECRET)
|
||||||
except NoUserException:
|
except NoUserException:
|
||||||
print("ERROR: generateToken: no user found, login or application wrong")
|
print("ERROR: generateToken: no user found, login or application wrong")
|
||||||
raise werkzeug.exceptions.Unauthorized()
|
raise werkzeug.exceptions.Unauthorized()
|
||||||
|
@ -3,7 +3,7 @@ from flask_cors import CORS
|
|||||||
|
|
||||||
# instantiate the webservice
|
# instantiate the webservice
|
||||||
app = connexion.App(__name__)
|
app = connexion.App(__name__)
|
||||||
app.add_api('openapi.yaml', options = {"swagger_ui": False})
|
app.add_api('openapi.yaml', options = {"swagger_ui": True})
|
||||||
|
|
||||||
# CORSify it - otherwise Angular won't accept it
|
# CORSify it - otherwise Angular won't accept it
|
||||||
CORS(app.app)
|
CORS(app.app)
|
||||||
|
Reference in New Issue
Block a user