summaryrefslogtreecommitdiffstats
path: root/routes/auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'routes/auth.py')
-rw-r--r--routes/auth.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/routes/auth.py b/routes/auth.py
index a34aaa5..934abc7 100644
--- a/routes/auth.py
+++ b/routes/auth.py
@@ -14,7 +14,7 @@
from ..helpers import *
-@route("/api/auth", method="POST")
+@post("/api/auth/register")
def post_auth_new():
session = DBSession()
try:
@@ -30,4 +30,10 @@ def post_auth_new():
except db.orm.exc.NoResultFound:
session.add(User(name=username, hash=hash))
session.commit()
- return HTTPResponse(status=201)
+ return HTTPResponse(status=303, headers={"Location" : "/api/auth"})
+
+@get("/api/auth")
+@jwt_auth_required
+def get_auth():
+ return request.get_user()
+