tokenify the last few payload routes #1174
Labels
👤 closed for help 👥
Closed to external help, team only
📝 feature 🧠
New feature or request
🫣 331 🤫
Is only in scope within the current 331 branch
There are 2 (or rather 3 if u include ctf) routes that still use a userdata payload (
prepareUserPayload
). These routes are/courses/getAllUnlocked/
and/courses/coursesUnlockedWhenTaken/
.Fix these to use token, as it is annoying me.
These routes require a
User
type object to work with (what is known as the "algo user"), as they do condition checking. However, you only get aStorage
type object from theget_setup_user(userid)
function. Thus, you will also need to create a function to convertStorage -> User
. Give this a go yourself first, otherwise I do have some old code for this. Feel free to put this function as a static method on theUser
class, would go hard.Once done, also remove the prepareUserPayload function, and trim down any user data fetches that were being called just for this.
The text was updated successfully, but these errors were encountered: