Using Lock signup with loginAfterSignUp: false


I am using lock for sign in and sign up. My sign up process is a stepped process. First two steps gather information about the user/business and the last step is lock to sign up. I have a timing problem, which i hope will be resolved with Until then, i need to use loginAfterSignUp: false so that i can gate the user from signing in until the user_metadata has all the info. How can i tell if the signup was a success?

Hi @bstaley0,

For the time being, the simplest way to implement this functionality would probably be to gate access using a rule. Rules run immediately after a user authenticates (which means they will run when the user signs up if loginAfterSignup is true and will not if it is false) and can used to grant or restrict access to your application. Please see our rule for requiring email verification for an example of this.

Instead of checking user.email_verified, you would want to create a rule which checks whether the metadata you require is present. This could be done by either checking each individual attribute and/or by adding a single metadata field to act as a flag which indicates whether the user/busieness’ profile is “complete” according to your specifications. You may find our documentation on using metadata in rules related best practices to be helpful.

Issue resolved, check out for full details.

1 Like

Thanks a lot for sharing it with the rest of community!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.