# HG changeset patch # User rougeronj # Date 1433441438 -7200 # Node ID e4ffc4e13a8ea551037e29f8f275a4d37d982759 # Parent b8400d8efac89b7cdfd124ff31ec1dbe800f0044 add a token field to the initialisation of the ammico app so the server can pass it and auto login with jwt diff -r b8400d8efac8 -r e4ffc4e13a8e client/app/app.js --- a/client/app/app.js Thu Jun 04 20:09:20 2015 +0200 +++ b/client/app/app.js Thu Jun 04 20:10:38 2015 +0200 @@ -74,11 +74,12 @@ redirectTo: '/' }); }) - .run( function($rootScope, $location, $window, $http, authApi) { + .run( function($rootScope, $location, $window, $http, authApi, context) { $rootScope.globals = {}; - if (localStorage.getItem('token')) { + if (localStorage.getItem('token') || context['token']) { $rootScope.globals.userLogged = true; - $http.defaults.headers.common.Authorization = 'Token ' + localStorage.getItem('token'); + localStorage.setItem('token', (localStorage.getItem('token') || context['token'])); + $http.defaults.headers.common.Authorization = 'Token ' + (localStorage.getItem('token') || context['token']); } $rootScope.$on( '$routeChangeStart', function(event, next) { if (next.authRequired && !$rootScope.globals.userLogged) { diff -r b8400d8efac8 -r e4ffc4e13a8e client/app/books/book.css --- a/client/app/books/book.css Thu Jun 04 20:09:20 2015 +0200 +++ b/client/app/books/book.css Thu Jun 04 20:10:38 2015 +0200 @@ -30,7 +30,7 @@ .gallery .item.no-img p { font-size: 38px; - height: 179px; + height: 173px; padding-top: 25px; } diff -r b8400d8efac8 -r e4ffc4e13a8e client/app/index.html --- a/client/app/index.html Thu Jun 04 20:09:20 2015 +0200 +++ b/client/app/index.html Thu Jun 04 20:10:38 2015 +0200 @@ -76,7 +76,9 @@