aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

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

Open martingrzzler opened 11 months ago

martingrzzler commented 11 months ago

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?

bodokaiser commented 11 months ago

Here are at least two more users having the same problem

nadetastic commented 11 months ago

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.

bodokaiser commented 11 months ago

@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 commented 9 months ago

Any updates?

ajkpersonal commented 6 months ago

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.

awadhwanan commented 6 months ago

BUMP @nadetastic Is there any update on this?

israx commented 6 months ago

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

shubhamkahndelwal commented 3 months ago

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