FIX: Issues signing in without local logins

This commit is contained in:
Robin Ward 2014-08-14 22:09:12 -04:00
parent 8e208d9d1c
commit 00c791b12e
3 changed files with 10 additions and 3 deletions

View File

@ -16,7 +16,9 @@ export default DiscourseController.extend(ModalFunctionality, {
prefilledUsername: null,
tosAccepted: false,
hasAuthOptions: Em.computed.notEmpty('authOptions'),
canCreateLocal: Discourse.computed.setting('enable_local_logins'),
showCreateForm: Em.computed.or('hasAuthOptions', 'canCreateLocal'),
resetForm: function() {
this.setProperties({

View File

@ -128,16 +128,19 @@ export default DiscourseController.extend(ModalFunctionality, {
authenticationComplete: function(options) {
if (options.requires_invite) {
this.send('showLogin');
this.flash(I18n.t('login.requires_invite'), 'success');
this.set('authenticate', null);
return;
}
if (options.awaiting_approval) {
this.send('showLogin');
this.flash(I18n.t('login.awaiting_approval'), 'success');
this.set('authenticate', null);
return;
}
if (options.awaiting_activation) {
this.send('showLogin');
this.flash(I18n.t('login.awaiting_confirmation'), 'success');
this.set('authenticate', null);
return;

View File

@ -1,8 +1,10 @@
{{#unless complete}}
<div class="modal-body">
{{login-buttons action="externalLogin"}}
{{#unless hasAuthOptions}}
{{login-buttons action="externalLogin"}}
{{/unless}}
{{#if canCreateLocal}}
{{#if showCreateForm}}
<div>
<form>
<table>
@ -73,7 +75,7 @@
{{/if}}
</div>
{{#if canCreateLocal}}
{{#if showCreateForm}}
<div class="modal-footer">
{{#if tosAcceptRequired}}
<div class="tos-agree">