# Login facebook in angular-fullstack-generator

**URL:** <https://forum.ionicframework.com/t/login-facebook-in-angular-fullstack-generator/45136>\
**Category:** ionic-v1\
**Created:** [March 1, 2016, 9:27am UTC](https://forum.ionicframework.com/t/login-facebook-in-angular-fullstack-generator/45136 "2016-03-01T09:27:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![feof84](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@feof84](https://forum.ionicframework.com/u/feof84)\
**Post date:** [March 1, 2016, 9:27am UTC](https://forum.ionicframework.com/t/login-facebook-in-angular-fullstack-generator/45136/1 "2016-03-01T09:27:24Z")

</div>

I have a problem with angular-fullstack-generator and I don’t know resolve. I have an app online at a specific address: [www.example.com](http://www.example.com), I have also an hybrid app, created with ionic, that runs in local.

The problem is logic. When I click login button in my ionic app, the button opens a location.href to address web $window.location.href = ‘/auth/’ + provider, that in my hybrid app will be file://blabla/auth/blabla and doesn’t work. So I use inappbrowser and I open [www.example.com/auth/blabla](http://www.example.com/auth/blabla), the user can do login , but the endpoint /auth/blabla will return a cookie in [www.example.com](http://www.example.com).

In nodejs I have:

export function setTokenCookie(req, res) {  
if (!req.user) {  
return res.status(404).send(‘It looks like you aren’t logged in, please try again.’);  
}  
var token = signToken(req.user.\_id, req.user.role);  
res.cookie(‘token’, token);  
res.redirect(’/’);  
}

The problem is this redirect will go [www.example.com](http://www.example.com), how can I handle it ? In Ionic I don’t have a server web, and I would not change login method because the app site is online.  
Help me, please.
