mirror of
https://github.com/discourse/discourse.git
synced 2025-03-05 18:59:22 +00:00
FIX: redirect to original URL when logging in via OAuth
This commit is contained in:
parent
f37f6f7673
commit
7abd4687e2
@ -184,7 +184,12 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
|
||||
// Reload the page if we're authenticated
|
||||
if (options.authenticated) {
|
||||
if (window.location.pathname === Discourse.getURL('/login')) {
|
||||
const destinationUrl = $.cookie('destination_url');
|
||||
if (self.get('loginRequired') && destinationUrl) {
|
||||
// redirect client to the original URL
|
||||
$.cookie('destination_url', null);
|
||||
window.location.href = destinationUrl;
|
||||
} else if (window.location.pathname === Discourse.getURL('/login')) {
|
||||
window.location.pathname = Discourse.getURL('/');
|
||||
} else {
|
||||
window.location.reload();
|
||||
|
Loading…
x
Reference in New Issue
Block a user