File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ var App = Ember.Application.extend({
12
12
} ) ;
13
13
14
14
loadInitializers ( App , config . modulePrefix ) ;
15
+ Ember . $ . ajaxSetup ( { cache : false } ) ;
15
16
16
17
export default App ;
Original file line number Diff line number Diff line change @@ -8,10 +8,12 @@ export default Ember.Route.extend({
8
8
this . session . get ( 'currentUser' ) === null )
9
9
{
10
10
return ajax ( '/me' ) . then ( function ( response ) {
11
+ console . log ( "good" , response ) ;
11
12
var user = self . store . push ( 'user' , response . user ) ;
12
13
user . set ( 'api_token' , response . api_token ) ;
13
14
self . session . set ( 'currentUser' , user ) ;
14
15
} ) . catch ( function ( ) {
16
+ console . log ( 'bad' ) ;
15
17
self . session . logoutUser ( ) ;
16
18
} ) ;
17
19
}
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ export default Ember.Object.extend({
9
9
} ,
10
10
11
11
loginUser : function ( user ) {
12
+ console . log ( 'login' , user ) ;
12
13
this . set ( 'isLoggedIn' , true ) ;
13
14
this . set ( 'currentUser' , user ) ;
14
15
localStorage . setItem ( 'isLoggedIn' , '1' ) ;
15
16
} ,
16
17
17
18
logoutUser : function ( ) {
19
+ console . log ( 'logout' ) ;
18
20
this . set ( 'savedTransition' , null ) ;
19
21
this . set ( 'isLoggedIn' , null ) ;
20
22
this . set ( 'currentUser' , null ) ;
You can’t perform that action at this time.
0 commit comments