Closed ghost closed 9 years ago
The "Redirecting..." page exists to send authentication info from the OAuth provider back to the angular app. Once the values are sent (via postMessage
), the window should close itself automatically.
There must be some kind of error that is preventing the window from sending messages.
Can you "View Source" on the "Redirecting..." page and post the results?
@lynndylanhurley - thank you. Please let me know if you need more.
<!DOCTYPE html>
<html>
<head>
<script>
var usingExternalWindow = function() {
var nav = navigator.userAgent.toLowerCase(),
ieLTE10 = (nav && nav.indexOf('msie') != -1),
ie11 = !!navigator.userAgent.match(/Trident.*rv\:11\./);
return !(ieLTE10 || ie11);
}
if (usingExternalWindow()) {
window.addEventListener("message", function(ev) {
if (ev.data === "requestCredentials") {
ev.source.postMessage({
"id": "162",
"email": "EMAIL",
"name": "NAME",
"nickname": "",
"image": "IMAGE",
"provider": "facebook",
"uid": "UID",
"created_at": "2014-11-20 16:21:36 UTC",
"updated_at": "2014-11-20 16:22:31 UTC",
"auth_token": "AUTH_TOKEN",
"message": "deliverCredentials",
"client_id": "CLIENT_ID",
"expiry": "1417710151"
}, '*');
window.close();
}
});
} else {
window.location.href = "http://localhost:3000/#/login?client_id=lLD5t3HG2J3aA8LvUE-nkg&expiry=1417710151&token=d_cMFIMsOohZ6lE0Kc_HEw&uid=10202974252489710";
}
</script>
</head>
<body>
<pre>
Redirecting...
</pre>
</body>
</html>
This looks ok actually. Are you seeing any JS console errors on either this page or the angular app?
Also, which browser are you using?
@lynndylanhurley - I'm no longer able to produce the error, so I'm closing this issue. Sorry for the noise.
Hey no problem! Glad everything worked out :smiley:
I have a problem with when I want to log in with facebook. The registration with facebook worked and user was created.
The login call opens a new window with "Redirecting..." and url "http://localhost:3000/api/auth/facebook/callback#_=_"
What do I miss?
My controller looks like this: