FIX: redirect loop for new users visiting /new-topic using full screen login
This commit is contained in:
parent
a9737e2813
commit
e183600563
|
@ -8,6 +8,7 @@ const Discourse = Ember.Application.extend({
|
||||||
_docTitle: document.title,
|
_docTitle: document.title,
|
||||||
RAW_TEMPLATES: {},
|
RAW_TEMPLATES: {},
|
||||||
__widget_helpers: {},
|
__widget_helpers: {},
|
||||||
|
showingSignup: false,
|
||||||
|
|
||||||
getURL(url) {
|
getURL(url) {
|
||||||
if (!url) return url;
|
if (!url) return url;
|
||||||
|
|
|
@ -34,7 +34,11 @@ export default Discourse.Route.extend({
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.cookie('destination_url', window.location.href);
|
$.cookie('destination_url', window.location.href);
|
||||||
this.replaceWith('login');
|
if (Discourse.showingSignup) {
|
||||||
|
Discourse.showingSignup = false;
|
||||||
|
} else {
|
||||||
|
self.replaceWith('login');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,12 @@ export default Discourse.Route.extend({
|
||||||
} else {
|
} else {
|
||||||
// User is not logged in
|
// User is not logged in
|
||||||
$.cookie('destination_url', window.location.href);
|
$.cookie('destination_url', window.location.href);
|
||||||
|
if (Discourse.showingSignup) {
|
||||||
|
// We're showing the sign up modal
|
||||||
|
Discourse.showingSignup = false;
|
||||||
|
} else {
|
||||||
self.replaceWith('login');
|
self.replaceWith('login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
<%- if !current_user && flash[:authentication_data] %>
|
<%- if !current_user && flash[:authentication_data] %>
|
||||||
|
Discourse.showingSignup = true
|
||||||
require('discourse/routes/application').default.reopen({
|
require('discourse/routes/application').default.reopen({
|
||||||
actions: {
|
actions: {
|
||||||
didTransition: function() {
|
didTransition: function() {
|
||||||
|
|
Loading…
Reference in New Issue