Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
56104a53
authored
Aug 14, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update of user data after submission
parent
0d19a06f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
sails/src/assets/scripts/modules/login/controllers/login.js
sails/src/assets/scripts/services/services.js
sails/src/assets/scripts/modules/login/controllers/login.js
View file @
56104a53
...
...
@@ -18,6 +18,7 @@ function LoginCtrl(
$stateParams
,
$timeout
,
ngToast
,
user
,
CONSTANTS
,
vcRecaptchaService
)
{
...
...
@@ -77,7 +78,7 @@ function LoginCtrl(
// user is in the scope of the MainCtrl
data
.
user
.
name
=
data
.
user
.
name
||
$translate
.
instant
(
'name'
);
data
.
user
.
surname
=
data
.
user
.
surname
||
$translate
.
instant
(
'surname'
);
$scope
.
user
=
JSON
.
parse
(
JSON
.
stringify
(
data
.
user
));
$window
.
sessionStorage
.
user
=
JSON
.
stringify
(
data
.
user
);
$location
.
path
(
'/students'
);
})
...
...
sails/src/assets/scripts/services/services.js
View file @
56104a53
...
...
@@ -31,6 +31,14 @@ module.factory('AuthInterceptorService', function ($rootScope, $q, $window) {
};
});
/**
* 'user' service, to make user information persists through ui-route
* This is a more convenient way that user $window.sessionStorage
*/
module
.
factory
(
"user"
,
function
(){
return
{};
});
// Add AuthInterceptorService to $httpProvider.interceptors
module
.
config
(
function
(
$httpProvider
)
{
$httpProvider
.
interceptors
.
push
(
'AuthInterceptorService'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment