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

Password hash is not saved when accepting an invite #8229

Closed
3 tasks done
grahamorrell opened this issue Sep 22, 2021 · 4 comments
Closed
3 tasks done

Password hash is not saved when accepting an invite #8229

grahamorrell opened this issue Sep 22, 2021 · 4 comments
Assignees
Labels

Comments

@grahamorrell
Copy link

Preflight Checklist

Describe the Bug

When I invite a user to the project (by email) and they click the link and enter a password it says "Account Created Successfully". However the "password" field for their record in directus_users is set to {}. They then (obviously) can't sign in using their password. If they log in via Google and change their password from their User Profile screen, the password is correctly saved, and they can now log in via email or Google. Its just that initial account creation which isn't working properly.

To Reproduce

  • Invite a user via email
  • Accept the invite
  • Enter a password and click create
  • Query the password hash in the directus_users table - it is { }

What version of Directus are you using?

v9.0.0-rc.93

What version of Node.js are you using?

15.14.0

What database are you using?

Postgres 13

What browser are you using?

Edge

What operating system are you using?

Windows

How are you deploying Directus?

Locally

@aidenfoxx
Copy link
Contributor

This should be fixed in #6942

@azrikahar
Copy link
Contributor

azrikahar commented Sep 22, 2021

It should be the missing await in this line (oversight in #7755), which was the finding @grahamorrell shared earlier in the Discord server:

const passwordHashed = generateHash(password);

@aidenfoxx
Copy link
Contributor

aidenfoxx commented Sep 22, 2021

@azrikahar #6942 fixes this by using the UsersService to update the user information, which is the preferred way to handle this as it enforced password security requirements.

@rijkvanzanten
Copy link
Member

Fixed in #6942

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants