Wait to load until currentUser returns
This commit is contained in:
parent
eb1a8bb6e3
commit
e36d327f36
12 changed files with 85 additions and 84 deletions
|
@ -1,17 +1,7 @@
|
|||
import Ember from 'ember';
|
||||
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';
|
||||
// import parseBase64 from '../../utils/parse-base64';
|
||||
|
||||
export default Ember.Route.extend(ApplicationRouteMixin, {
|
||||
// model: function() {
|
||||
// let token = this.get('session.secure.token');
|
||||
// if (Ember.isNone(token)) {
|
||||
// return null;
|
||||
// }
|
||||
// let user = parseBase64(token);
|
||||
// return this.store.find('user', user.sub);
|
||||
// },
|
||||
|
||||
actions: {
|
||||
invalidateSession: function() {
|
||||
this.get('session').invalidate().then(() => {
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
{{#x-application}}
|
||||
<div class="flakes-navigation">
|
||||
{{site-logo}}
|
||||
{{#if session.isAuthenticated}}
|
||||
<ul>
|
||||
{{#link-to 'protected.compare' tagName='li' href=false}}
|
||||
{{link-to 'Compare' 'protected.compare'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.measurements' tagName='li' href=false}}
|
||||
{{link-to 'Measurements' 'protected.measurements'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.characteristics' tagName='li' href=false}}
|
||||
{{link-to 'Characteristics' 'protected.characteristics'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.species' tagName='li' href=false}}
|
||||
{{link-to 'Species' 'protected.species'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.strains' tagName='li' href=false}}
|
||||
{{link-to 'Strains' 'protected.strains'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.about' tagName='li' href=false}}
|
||||
{{link-to 'About' 'protected.about'}}
|
||||
{{/link-to}}
|
||||
</ul>
|
||||
<p class="foot">
|
||||
{{session.currentUser.name}}<br>
|
||||
<a {{action 'invalidateSession'}}>Logout</a>
|
||||
</p>
|
||||
{{else}}
|
||||
<p class="foot">
|
||||
{{link-to 'Login' 'login'}}
|
||||
<br>
|
||||
{{link-to 'Sign Up' 'users.new'}}
|
||||
</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="flakes-content">
|
||||
<div class="flakes-mobile-top-bar">
|
||||
{{site-logo}}
|
||||
<a href="" class="navigation-expand-target">
|
||||
<img src="img/navigation-expand-target.png" height="26px">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="view-wrap">
|
||||
{{#each flashMessages.queue as |flash|}}
|
||||
{{custom-flash-message flash=flash}}
|
||||
{{/each}}
|
||||
{{outlet}}
|
||||
</div>
|
||||
</div>
|
||||
{{/x-application}}
|
Reference in a new issue