amplify-js icon indicating copy to clipboard operation
amplify-js copied to clipboard

`signIn` in `v6` does not expose the active `signInSession`

Open martingrzzler opened this issue 2 years ago • 8 comments

Is this related to a new or existing framework?

No response

Is this related to a new or existing API?

Authentication

Is this related to another service?

No response

Describe the feature you'd like to request

Auth.signIn used to return a CognitoUser with a Session which could be stored and persisted such that one could continue a login session in a different browser tab by recreating the CognitoUser with the persisted session and calling Auth.sendCustomChallengeAnswer(cognitoUser, answer). In v6 this is no longer possible since the signInSession is handled internally.

I need this feature in order to implement magic sign-in links as described in this blog post: https://aws.amazon.com/blogs/mobile/implementing-passwordless-email-authentication-with-amazon-cognito/

Describe the solution you'd like

Is there a workaround in v6 that allows to set the signInSession of the signInStore in order to continue the session in a different browser tab?

Describe alternatives you've considered

Downgrade to v5

Additional context

No response

Is this something that you'd be interested in working on?

  • [ ] 👋 I may be able to implement this feature request
  • [x] ⚠️ This feature might incur a breaking change

martingrzzler avatar Nov 28 '23 15:11 martingrzzler

Here are at least two more users having the same problem

bodokaiser avatar Nov 28 '23 17:11 bodokaiser

Hi @martingrzzler, thank you for opening this issue. This functionality has indeed changed in V6, however the dev team will be reviewing this use case and will follow up soon. In the meantime, I have marked this as a feature request. Let me know if you have additional questions.

nadetastic avatar Nov 29 '23 00:11 nadetastic

@nadetastic Maybe a more general solution to the problem is a Storage interface as used in v5? This would also re-enable the use of authenticated chrome extensions, which overwrote the Storage interface to sync the localStorage of the browser with the chrome.storage.local of the extension.

bodokaiser avatar Nov 29 '23 06:11 bodokaiser

Any updates?

bodokaiser avatar Feb 02 '24 09:02 bodokaiser

I'm trying to implement sign-in with magic links and this issue seems to make it impossible to implement in v6 since the link sent to and email gets opened in a new tab. Will update here if I find a workaround, but this seems super important if it prevents such a common sign in pattern.

ajkpersonal avatar Apr 23 '24 20:04 ajkpersonal

BUMP @nadetastic Is there any update on this?

awadhwanan avatar May 08 '24 22:05 awadhwanan

Hello everyone, apologies for the delayed response. We are actively working on this feature and will notify with any updates.

israx avatar May 09 '24 12:05 israx

@israx Any Updates?? trying to implement Magic link, but facing same issue not maintain the session in new tab

shubhamkahndelwal avatar Aug 05 '24 12:08 shubhamkahndelwal