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

Why isn't the registration using the correct Directus way? #282

Open
or2e opened this issue Nov 24, 2024 · 1 comment
Open

Why isn't the registration using the correct Directus way? #282

or2e opened this issue Nov 24, 2024 · 1 comment
Labels
question Further information is requested

Comments

@or2e
Copy link

or2e commented Nov 24, 2024

Hi, I looked through the discussion thread and didn't find a similar question

Thanks for the great module!

I have a question.

Why does the register||createUser function directly create a user without using the great Directus functionality out of the box?

/users/register

/users/register/verify-email

At the same time, the requestPasswordReset method uses a similar Directus mechanism with verification


Some example
const register = async (data: DirectusRegisterCredentials & { verification_url: string }): Promise<void> => {
  return await directus('/users/register', {
    method: 'POST',
    body: data,
  })
}

const verifyEmail = async (token: string): Promise<void> => {
  return await directus('/users/register/verify-email', {
    method: 'GET',
    params: {
      token,
    },
  })
}

So we can use the boxed mechanism for user registration verification (sending an email)

@or2e or2e added the question Further information is requested label Nov 24, 2024
@Intevel
Copy link
Owner

Intevel commented Nov 25, 2024

Feel free to make a PR 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants