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

[email provider] invalidate previous login links #779

Closed
slaivyn opened this issue Oct 16, 2020 · 4 comments
Closed

[email provider] invalidate previous login links #779

slaivyn opened this issue Oct 16, 2020 · 4 comments
Labels
enhancement New feature or request providers

Comments

@slaivyn
Copy link

slaivyn commented Oct 16, 2020

Summary of proposed feature
Any call to signIn function/REST API endpoint of the email provider should invalidate any previously created login link.

Purpose of proposed feature
The goal is to increase the security level of this provider.

Potential problems
I can't see any issue with that change proposal

Describe any alternatives you've considered
I can't find any alternative

Additional context
This is a recommendation from a security auditor based on WASP guidelines.

I am a bit busy right now but later I could try to implement it myself if the feature is accepted

@slaivyn slaivyn added the enhancement New feature or request label Oct 16, 2020
@iaincollins
Copy link
Member

Thanks for raising this feature!

I think this is a good suggestion and we should take it into account when working on the email provider - probably adding it at the same time as we look at rate limiting and/or adding support for short validation codes (in addition to the links).

@stale stale bot added the stale Did not receive any activity for 60 days label Feb 8, 2021
@nextauthjs nextauthjs deleted a comment from stale bot Feb 8, 2021
@stale stale bot removed the stale Did not receive any activity for 60 days label Feb 8, 2021
@stale stale bot added the stale Did not receive any activity for 60 days label Apr 9, 2021
@nextauthjs nextauthjs deleted a comment from stale bot Apr 9, 2021
@stale stale bot removed the stale Did not receive any activity for 60 days label Apr 9, 2021
@stale stale bot added the stale Did not receive any activity for 60 days label Jun 8, 2021
@nextauthjs nextauthjs deleted a comment from stale bot Jun 8, 2021
@stale stale bot removed the stale Did not receive any activity for 60 days label Jun 8, 2021
@balazsorban44
Copy link
Member

balazsorban44 commented Jul 18, 2021

In #2361, I am going to make it required for the adapter developers to delete the previous token used for signin in their , no matter if the signin was successful or not. This means that in case of an error, a user must receive a new email with a new link as the old will be invalidated/gone.

See useVerificationToken:

const invite = await useVerificationToken({

If I understand the proposal here, that, should be addressed in that PR.

@slaivyn
Copy link
Author

slaivyn commented Jul 24, 2021

that sounds great!

@balazsorban44
Copy link
Member

balazsorban44 commented Aug 15, 2021

This has been released in 4.0.0-next.22! From that version and up, adapters are expected to only return the verification token once and delete it from the database after usage. See the useVerificationToken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request providers
Projects
None yet
Development

No branches or pull requests

4 participants