Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 2826e08

Browse files
committed
Fix: add access token prior to assignment selection
1 parent 19dd137 commit 2826e08

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

controllers/peer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ def num_answers():
200200
#
201201
@auth.requires_login()
202202
def student():
203+
204+
if "access_token" not in request.cookies:
205+
# this means the user is logged in to web2py but not fastapi - this is not good
206+
# as the javascript in the questions assumes the new server and a token.
207+
logger.error(f"Missing Access Token: {auth.user.username} adding one Now")
208+
_create_access_token(
209+
{"sub": auth.user.username}, expires=datetime.timedelta(days=30)
210+
)
211+
203212
assignments = db(
204213
(db.assignments.is_peer == True)
205214
& (db.assignments.course == auth.user.course_id)

0 commit comments

Comments
 (0)