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

autoregister #102

Open
pleddy opened this issue Sep 9, 2015 · 2 comments
Open

autoregister #102

pleddy opened this issue Sep 9, 2015 · 2 comments

Comments

@pleddy
Copy link

pleddy commented Sep 9, 2015

UPDATE: if user already exists, forgot to authenticate, fixed, but didn't test, new pastebin.

Took a while for me to figure this out, might be easier way. Think it might help others.

http://pastebin.com/YD8TXJv7

Don't know how to do push requests, took a look.

@saintedlama
Copy link
Owner

What's not working/working there? I've no idea how to deal with this issue. Give me a hint 🎱

@pleddy
Copy link
Author

pleddy commented Sep 14, 2015

Sorry, not an issue, but thought it would help people who want to not have a separate registration page. Makes use of "req.login", "user.authenticate" and "Account.findOne" whereas the example does not. And "req.login" is covered in passport docs, not here.

Also, for the less experienced programmer, the difference of "static" and "instance methods" might be too abstract. Luckily, I studied some Java, so recalled from there. Maybe this code snippet will help them.

And, would be nice to make "callback arguments" more prominent as its own section since my eyeballs saw it as a subsection of the resetAttempts(cb) section alone, not as a general signature for all instance methods.

Anyways, just close issue. I thought I'd put this here for others with similar needs.

Oh, BTW, first pastebin I posted did not do "authenticate" for an existing user, so that the req.user did not exist. Fixed in this pastebin.

Last, some of the error handling is just plain wrong/buggy. :)

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

2 participants