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,
|
||||
RAW_TEMPLATES: {},
|
||||
__widget_helpers: {},
|
||||
showingSignup: false,
|
||||
|
||||
getURL(url) {
|
||||
if (!url) return url;
|
||||
|
|
|
@ -34,7 +34,11 @@ export default Discourse.Route.extend({
|
|||
});
|
||||
} else {
|
||||
$.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 {
|
||||
// User is not logged in
|
||||
$.cookie('destination_url', window.location.href);
|
||||
if (Discourse.showingSignup) {
|
||||
// We're showing the sign up modal
|
||||
Discourse.showingSignup = false;
|
||||
} else {
|
||||
self.replaceWith('login');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
<script>
|
||||
<%- if !current_user && flash[:authentication_data] %>
|
||||
Discourse.showingSignup = true
|
||||
require('discourse/routes/application').default.reopen({
|
||||
actions: {
|
||||
didTransition: function() {
|
||||
|
|
Loading…
Reference in New Issue