-
Hello, this is a great library and I really like it after using it in our SvelteKit app for several days, thanks for your fantastic work! The problem is my application requires that we could bind specific data with certain auth key, similar to 'user attributes' in some sense, but for keys but not users. For instance, user Alice have 2 auth keys, when she login with the first key she would have full access to our application, and when she login with the second key she would have read-only access. After digging into the docs, I guess we could implement this feature with custom adapter, but it looks like quite some work, I'm curious are there any simpler solution to this problem? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Shortly after posting here I figured it's more complicated than I first thought, and I came up with a hack-ish idea using monkey patch.
Any ideas? |
Beta Was this translation helpful? Give feedback.
-
Done, this approach works perfectly. |
Beta Was this translation helpful? Give feedback.
Shortly after posting here I figured it's more complicated than I first thought, and I came up with a hack-ish idea using monkey patch.
auth_key
tableauth_session
andauth_key
, as we would need to know which key was used to derive current sessioncreateSession()
to record the key with the derived sessionAuthRequest.validataUser()
to read the related key and its custom attributes from current session, now we should get what we wantAny ideas?