[page.noauth.login] fetch UID from login request

This commit is contained in:
xdrm-brackets 2018-03-29 13:22:00 +02:00
parent bb8a985db3
commit 0676b8d747
1 changed files with 2 additions and 2 deletions

View File

@ -42,13 +42,13 @@ gs.get.login.func.login = function(){
api.call('GET /user/token', {}, function(rs){
// manage error
if( rs.error !== 0 || rs.token == null )
if( rs.error !== 0 || rs.token == null || rs.uid == null )
return this.failed = true;
// store TOKEN + user data
auth.token = rs.token;
auth.user = {
uid: null, // todo
uid: rs.uid,
username: username
};
document.location = '';