mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: /signup route will show sign up modal for private sites too if they allow registrations
This commit is contained in:
parent
2ff4248c19
commit
ccbbfbc24e
1 changed files with 23 additions and 7 deletions
|
@ -1,9 +1,25 @@
|
|||
export default Discourse.Route.extend({
|
||||
beforeModel: function() {
|
||||
this.replaceWith('discovery.latest').then(function(e) {
|
||||
Ember.run.next(function() {
|
||||
e.send('showCreateAccount');
|
||||
import buildStaticRoute from 'discourse/routes/build-static-route';
|
||||
|
||||
const SignupRoute = buildStaticRoute('signup');
|
||||
|
||||
SignupRoute.reopen({
|
||||
beforeModel() {
|
||||
var canSignUp = this.controllerFor("application").get('canSignUp');
|
||||
|
||||
if (!this.siteSettings.login_required) {
|
||||
this.replaceWith('discovery.latest').then(e => {
|
||||
if (canSignUp) {
|
||||
Ember.run.next(() => e.send('showCreateAccount'));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
} else {
|
||||
this.replaceWith('login').then(e => {
|
||||
if (canSignUp) {
|
||||
Ember.run.next(() => e.send('showCreateAccount'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default SignupRoute;
|
||||
|
|
Loading…
Reference in a new issue