Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to re-authenticate a user #14239

Open
2 tasks
Mitelak opened this issue Feb 24, 2025 · 0 comments
Open
2 tasks

A way to re-authenticate a user #14239

Mitelak opened this issue Feb 24, 2025 · 0 comments
Labels
pending-maintainer-response Issue is pending a response from the Amplify team. pending-triage Issue is pending triage

Comments

@Mitelak
Copy link

Mitelak commented Feb 24, 2025

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

I have a potentially destructive operation, like changing the account email. To confirm it's "safe" to change that email, on the backend, we check auth_time to be a recent one.

In v5, we ask users for their password and call signIn with it so they get a fresher auth_time.
In v6, it is no longer possible to call signIn on the authenticated user.

What's the best way to solve this in v6?
Is there any option to update auth_time, bypass assertUserNotAuthenticated, or ask for re-entering password as a form of confirmation?

Describe the solution you'd like

For the auth_time use case:

  • an additional option for signIn method to bypass user authentication check
  • a direct export of more low-level methods like signInWithUserPassword
  • another way to bump this value, like a revalidatePassword or something

The password confirmation use case in general:

  • a method for confirming user password and that updates property similar to auth_time like password_confirmation_time
  • any other way to confirm that the user passed the correct password, while being already authenticated

Describe alternatives you've considered

There is a hack that could mimic the v5 behavior:

  1. Backup cookies
  2. Sign out
  3. Try to sign in
  4. If error, bring back backup; if successful, do nothing

Additional context

No response

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

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending a response from the Amplify team. labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-maintainer-response Issue is pending a response from the Amplify team. pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

1 participant