Replies: 3 comments 1 reply
-
(just commenting to be notified, I created the issue with a wrong account) |
Beta Was this translation helpful? Give feedback.
-
Can't you simply use cookies to store the selected profile? Not sure if should go to the DB or the access token in general |
Beta Was this translation helpful? Give feedback.
-
Honestly I didn't think about that. The point is that my SvelteKit frontend makes server-side requests to the API, so I would need to handle the cookie manually, and check that the user have the permission on each request on the backend. If the requests were made client-side this would be a good thing to do, but in my case I would prefer storing it on the backend. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm currently implementing a multi-profile authentication in my application (when a user is connecting, he can choose between different profiles).
To store the currently selected profile, I've added a column in the
auth_access_tokens
table. However, to have this new column accessible in tokens likeUser.currentAccessToken
in code, there's a lot of modifications to do: we need to extendAccessToken
,DbAccessTokensProvider
and the guard (at least this is the way I found to do it).Wouldn't it be a good thing to transform the
AccessToken
internal class to a model stored in our application? This would allow to edit properties in it, and also handling it like any other Lucid model.Beta Was this translation helpful? Give feedback.
All reactions