Skip to content

Commit

Permalink
Use get_identity instead of get_auth_user
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Nov 29, 2023
1 parent 5269667 commit 01464c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Flask-JWT-Extended==4.4.4
flask-restx==1.1.0
psycopg2==2.9.6
SQLAlchemy==1.4.48
qwc-services-core==1.3.19
qwc-services-core==1.3.20
16 changes: 8 additions & 8 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from urllib.parse import urlparse, parse_qs
from sqlalchemy.sql import text as sql_text

from qwc_services_core.auth import auth_manager, optional_auth, get_auth_user, get_username
from qwc_services_core.auth import auth_manager, optional_auth, get_identity, get_username
from qwc_services_core.api import CaseInsensitiveArgument
from qwc_services_core.database import DatabaseEngine
from qwc_services_core.tenant_handler import TenantHandler
Expand Down Expand Up @@ -167,7 +167,7 @@ class UserPermalink(Resource):
@api.doc('getuserpermalink')
@optional_auth
def get(self):
username = get_username(get_auth_user())
username = get_username(get_identity())
if not username:
return jsonify({})

Expand All @@ -189,7 +189,7 @@ def get(self):
@api.expect(createpermalink_parser)
@optional_auth
def post(self):
username = get_username(get_auth_user())
username = get_username(get_identity())
if not username:
return jsonify({"success": False})

Expand Down Expand Up @@ -234,7 +234,7 @@ class UserBookmarksList(Resource):
@bk.doc('getbookmarks')
@optional_auth
def get(self):
username = get_username(get_auth_user())
username = get_username(get_identity())
if not username:
return jsonify([])

Expand Down Expand Up @@ -269,7 +269,7 @@ def get(self):
@bk.expect(userbookmark_parser)
@optional_auth
def post(self):
username = get_username(get_auth_user())
username = get_username(get_identity())
if not username:
return jsonify({"success": False})

Expand Down Expand Up @@ -326,7 +326,7 @@ class UserBookmark(Resource):
@bk.doc('getbookmark')
@optional_auth
def get(self, key):
username = get_username(get_auth_user())
username = get_username(get_identity())
if not username:
return jsonify({"success": False})

Expand All @@ -345,7 +345,7 @@ def get(self, key):
@bk.doc('deletebookmark')
@optional_auth
def delete(self, key):
username = get_username(get_auth_user())
username = get_username(get_identity())
if not username:
return jsonify({"success": False})

Expand All @@ -368,7 +368,7 @@ def delete(self, key):
@bk.expect(userbookmark_parser)
@optional_auth
def put(self, key):
username = get_username(get_auth_user())
username = get_username(get_identity())
if not username:
return jsonify({"success": False})

Expand Down

0 comments on commit 01464c2

Please sign in to comment.