remix-auth-oauth2
remix-auth-oauth2 copied to clipboard
Consider account linking
Hello, great work!
I was looking how an account linking strategy could be implemented and looking at a few passport examples, I saw it was possible to access the request (and knowing if a user is already signed in or not). Would you consider having this implemented?
I think it may also need something like #14 if the "already logged in then ignore" behavior is to be kept.
Sources:
- https://codeburst.io/account-linking-with-passportjs-in-3-minutes-2cb1b09d4a76
- https://github.com/jaredhanson/passport-oauth2/blob/master/lib/strategy.js
Agreed. A potential implementation can be:
At https://github.com/sergiodxa/remix-auth-oauth2/blob/main/src/index.ts#L138, we can add an option: linkAccount
.
If user sets this option to true
, it simply bypasses the https://github.com/sergiodxa/remix-auth-oauth2/blob/main/src/index.ts#L149 line.
CC: @sergiodxa
plug. I use this lib in https://github.com/proofzero/rollupid which supports account linking with a twist...Rollup turns the user into the "issuer".
In #89 now you can call the authenticate method and it will do the process again, allowing linking accounts.