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

How to identify that Email Already taken while signup #17

Open
nsisodiya opened this issue Dec 27, 2014 · 7 comments
Open

How to identify that Email Already taken while signup #17

nsisodiya opened this issue Dec 27, 2014 · 7 comments

Comments

@nsisodiya
Copy link

It is my first day with waterlock auth. It is working perfectly at my end.
However, I noticed that

/auth/login

create new signup of user, as well login the user.

I think, we should have two urls for this

one for creating user and other for login the user.

Because in my application, When user is creating new login/signup , he should get notified that this email/userId is already taken.

Thanks

@duhruh
Copy link
Member

duhruh commented Dec 28, 2014

Yes! That is a good idea, however this was the intended functionality. If you wanted to disable this you can simply change the createOnNotFound to false then implement your own register form.

@nsisodiya
Copy link
Author

may you send me further details.. where to change the flag

@nsisodiya
Copy link
Author

May you give further help, in which file this flag createOnNotFound is located and how I need to change it !

@nsisodiya
Copy link
Author

I got the location of the flag !
Thanks !

@duhruh
Copy link
Member

duhruh commented Dec 29, 2014

Sure thing! If you head over to the README file and checkout the Usage section you'll notice that the createOnNotFound flag should be in the waterlock.js file. 😄

@nsisodiya
Copy link
Author

Yes, I am going to create a registation form !
Because I have two forms, I need two url too !
I know one url

/auth/login

This is for login, What is the url for creating new user (via registration form) ?

@nsisodiya nsisodiya reopened this Dec 29, 2014
@wayne-o
Copy link
Contributor

wayne-o commented Feb 11, 2015

I could be wrong but I think you need to create a new register action here:

https://github.com/waterlock/waterlock-local-auth/blob/master/lib/controllers/actions/login.js

And then a new function in generateScope (https://github.com/waterlock/waterlock-local-auth/blob/master/lib/scope.js) which can register the new user - basically regardless of whether createOnNotFound is true or false. To be clear, in your generateRegisterScope function you should not be checking for createOnNotFound because you will have set that to false to stop the login action from doing this for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants