Skip to content

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

@or2e

Description

@or2e

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions