angular-sailsjs-boilerplate icon indicating copy to clipboard operation
angular-sailsjs-boilerplate copied to clipboard

Not seeing user registration?

Open sfielder opened this issue 10 years ago • 14 comments

Is there a reason for no user reg?

Thanks and looking for a recommendation on how best to handle new signups

sfielder avatar Sep 26 '14 13:09 sfielder

I'm planning to do user CRUD after login, which is also requested #20 . Also I'm doing major refactor job atm to whole boilerplate so I have to finish those first.

Sorry, that I cannot give you any timeframe for this, but it's coming at somepoint. Feel free to make a PR about this or/and continue this thread with wishes and actual functionality spec about this feature.

tarlepp avatar Sep 26 '14 14:09 tarlepp

I'm curious how this is going to be done with the client and server being on two different domains. So far, I haven't been successful, getting Facebook and Google login/registration working.

They're don't allow you to make an ajax request to the backend, then have the response redirect you to facebook/google. (which is a good thing)

I've had to resort to using a login page severed up from sails, bypassing the frontend. Still, you have to set the auth_token on the frontend domain's localstorage. I guess I could use a cross-domain hack to do this.

I'm starting to think running the backend and frontend on two different domains is a horrible idea. Deploying this is also tricky, especially if pushing to heroku or something similar. That's for another discussion though.

stevenirby avatar Oct 16 '14 07:10 stevenirby

@stevenirby basically like this http://matthewtyler.io/handling-oauth2-with-node-js-and-angular-js-passport-to-the-rescue/

tarlepp avatar Oct 16 '14 07:10 tarlepp

@tarlepp thank you! I finally got it working. I needed to do this:

response.writeHead(302, {
    'Location' : 'http://localhost:3001/dashboard?token=' + data.token + '&user=' + user.email
});
response.end();

Instead I was trying to return json to the client or just do a response.redirect('http://localhost:3001/dashboard', 200);

stevenirby avatar Oct 16 '14 21:10 stevenirby

That link is dead. How do I do local and oauth registration?

ProLoser avatar Dec 01 '14 01:12 ProLoser

This one is "hard", I'm thinking to make something for this in my "christmas" holiday - maybe.

tarlepp avatar Dec 06 '14 19:12 tarlepp

So basically no progress on my "christmas" holiday for this... Now I got some time for this project again, not much but some, so I'll try to implement this. And if you guys have already done this, please share that.

tarlepp avatar Feb 21 '15 11:02 tarlepp

+1

ghost avatar Mar 08 '15 04:03 ghost

This is something that I should take proper look, unfortunately I don't really time to do all this... So if one you have done this already please make a PR.

tarlepp avatar Jun 06 '15 21:06 tarlepp

I'm having trouble where the user information is sent to the oauth popup window rather than the web app. Sometimes it will show the JWT token, other times it shows an "Invalid User Error"

Tenkir avatar Jun 13 '15 21:06 Tenkir

@Tenkir popup?

tarlepp avatar Jun 13 '15 23:06 tarlepp

@tarlepp: Facebook's login page popup window.

Tenkir avatar Jun 15 '15 00:06 Tenkir

@Tenkir oh ok, that explains. Note that only local auth is supported atm.

tarlepp avatar Jun 15 '15 15:06 tarlepp

I've almost got this worked out, I'm just having an issue getting the data from the oauth popup back to the angular app. I'm getting:

DOMException: Blocked a frame with origin "http://localhost:9000" from accessing a cross-origin frame.

Anyone have any idea how to get this working? Once it does I'll open a PR.

Here's a gist: https://gist.github.com/Tenkir/ffe243b85ebb98e0910f

EDIT: I got this working, though it's not elegant. Basically I pull the JSON text from the HTML body and parse it into the parent window.

Tenkir avatar Jul 30 '15 18:07 Tenkir