Code Monkey home page Code Monkey logo

Comments (14)

tarlepp avatar tarlepp commented on August 21, 2024

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.

from angular-sailsjs-boilerplate.

stevenirby avatar stevenirby commented on August 21, 2024

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.

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

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

from angular-sailsjs-boilerplate.

stevenirby avatar stevenirby commented on August 21, 2024

@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);

from angular-sailsjs-boilerplate.

ProLoser avatar ProLoser commented on August 21, 2024

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

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

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

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

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.

from angular-sailsjs-boilerplate.

 avatar commented on August 21, 2024

+1

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

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.

from angular-sailsjs-boilerplate.

Tenkir avatar Tenkir commented on August 21, 2024

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"

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

@Tenkir popup?

from angular-sailsjs-boilerplate.

Tenkir avatar Tenkir commented on August 21, 2024

@tarlepp: Facebook's login page popup window.

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

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

from angular-sailsjs-boilerplate.

Tenkir avatar Tenkir commented on August 21, 2024

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.

from angular-sailsjs-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.