Skip to content

Simulate login form values for authenticate() #149

Answered by sergiodxa
binajmen asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a reason why you can't call register inside the FormStrategy?

authenticator.use(
  new FormStrategy(async ({ form }) => {
    let email = form.get("email")
    let password = await form.get("password");

    if (!password) {
      let result = await register(form, catalog)
      return await verifyUser(email, result.password
    }

    return await verifyUser(email, password);
  }),
  'form',
);

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@sergiodxa
Comment options

@binajmen
Comment options

@binajmen
Comment options

@sergiodxa
Comment options

@binajmen
Comment options

Answer selected by binajmen
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants