You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Send the session token with the LiveView connect params, so that on_mount hooks and live_session can load/require users before any specific LiveView mount.
#41
Closed
sax opened this issue
Feb 11, 2023
· 0 comments
· Fixed by #50
Is your feature request related to a problem? Please describe.
I've found this library to be a great start to adding passkeys to my application, but specific implementations make it challenging to add as-is. The token component is great, but when I have push navigation the current setup means that I have to check in all of my handle_params as well as all of my handle_event callbacks to know whether a user is already loaded, and every single live view I make needs to copy the same 3+ handle_info callbacks in order to work.
This might be more for the example repo than for the library itself, but if the hooks were broken apart a bit more it might be more clear how to use connect params to load a user in on_mount.
Describe the solution you'd like
Break out at least one utility function from the token hook, for getting and setting the session token.
(maybe) split the token component into two, one of which handles logout. This would mean that logged-in liveviews would only need to implement callbacks for token deletion, rather than all token callbacks.
Describe alternatives you've considered
I've instead used this library as a reference for writing my own components and hooks. If you find security issues or more complete integration code, I'll need to follow your fixes and apply them to my code.
Additional context
This is great work! It and your conference presentation were really helpful for me to add passkey support to my app.
The text was updated successfully, but these errors were encountered:
sax
changed the title
I'd like to send the session token with the LiveView connect params, so that on_mount hooks and live_session can load/require users before any specific LiveView mount.
Send the session token with the LiveView connect params, so that on_mount hooks and live_session can load/require users before any specific LiveView mount.
Feb 11, 2023
Is your feature request related to a problem? Please describe.
I've found this library to be a great start to adding passkeys to my application, but specific implementations make it challenging to add as-is. The token component is great, but when I have push navigation the current setup means that I have to check in all of my handle_params as well as all of my handle_event callbacks to know whether a user is already loaded, and every single live view I make needs to copy the same 3+ handle_info callbacks in order to work.
This might be more for the example repo than for the library itself, but if the hooks were broken apart a bit more it might be more clear how to use connect params to load a user in on_mount.
Describe the solution you'd like
Describe alternatives you've considered
I've instead used this library as a reference for writing my own components and hooks. If you find security issues or more complete integration code, I'll need to follow your fixes and apply them to my code.
Additional context
This is great work! It and your conference presentation were really helpful for me to add passkey support to my app.
The text was updated successfully, but these errors were encountered: