remix-auth-oauth2 icon indicating copy to clipboard operation
remix-auth-oauth2 copied to clipboard

Consider account linking

Open YoruNoHikage opened this issue 2 years ago • 2 comments

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

YoruNoHikage avatar Jul 18 '22 06:07 YoruNoHikage

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

harshPPatel avatar Aug 07 '22 15:08 harshPPatel

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".

maurerbot avatar Apr 28 '23 22:04 maurerbot

In #89 now you can call the authenticate method and it will do the process again, allowing linking accounts.

sergiodxa avatar May 17 '24 23:05 sergiodxa