Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Changed login page to not be available after login.
Browse files Browse the repository at this point in the history
Fixes #399
  • Loading branch information
jkleinsc committed Apr 25, 2016
1 parent 07e8db9 commit 71d4b8e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions app/routes/login.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import Ember from 'ember';
export default Ember.Route.extend({
import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin';
export default Ember.Route.extend(UnauthenticatedRouteMixin, {
config: Ember.inject.service(),
beforeModel: function() {
return this.get('config').useGoogleAuth().then(function(useGoogleAuth) {
if (useGoogleAuth) {
window.location.replace('/auth/google');
}
});
beforeModel: function(transition) {
if (this.get('session').get('isAuthenticated')) {
this._super(transition);
} else {
return this.get('config').useGoogleAuth().then(function(useGoogleAuth) {
if (useGoogleAuth) {
window.location.replace('/auth/google');
}
});
}
}
});

0 comments on commit 71d4b8e

Please sign in to comment.