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, prefilledUsername: null,
tosAccepted: false, tosAccepted: false,
hasAuthOptions: Em.computed.notEmpty('authOptions'),
canCreateLocal: Discourse.computed.setting('enable_local_logins'), canCreateLocal: Discourse.computed.setting('enable_local_logins'),
showCreateForm: Em.computed.or('hasAuthOptions', 'canCreateLocal'),
resetForm: function() { resetForm: function() {
this.setProperties({ this.setProperties({

View File

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

View File

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