Browse Source

[FIX] store user information

Gogs 7 years ago
parent
commit
14788e9bba
3 changed files with 10 additions and 16 deletions
  1. 2 2
      src/pages/login/login.ts
  2. 1 1
      src/services/auth-service.ts
  3. 7 13
      src/services/sync-service.ts

+ 2 - 2
src/pages/login/login.ts

@@ -56,14 +56,14 @@ export class LoginPage {
 			content: "Identificando usuario, espere..."
 		});
 		this.loader.present();
-		this.auth.signin(loginInformation).subscribe(result => this.signinSuccess(result), error => this.signinError(error));
+		this.auth.signin(loginInformation).subscribe(response => this.signinSuccess(Object.assign(loginInformation, response)), error => this.signinError(error));
 	}
 
 	/**
 	 *
 	 */
 	signinSuccess(data: any): void {
-		this.auth.storeInformation(data);
+		this.auth.storeLoginInformation(data);
 		this.loader.dismiss();
 		this.navCtrl.setRoot(HomePage);
 	}

+ 1 - 1
src/services/auth-service.ts

@@ -60,7 +60,7 @@ export class AuthService {
     /**
      *
      */
-    storeInformation(loginInformation: any): Observable<any> {
+    storeLoginInformation(loginInformation: any): Observable<any> {
         localStorage.setItem("odoo", JSON.stringify(loginInformation));
         
         return Observable.empty();

+ 7 - 13
src/services/sync-service.ts

@@ -33,21 +33,15 @@ export class SyncService {
     }
 
     /**
-     *
-     */
+     * FIXME:
+     * 
+     * [x]  modificando el manejo de inicio de sesion de no guarda la informacion del usuario y contrasena
+     *      imposibilitando la sincronizacion de datos
+    */
+
     protected login(): Observable<any> {
         let loginInformation = JSON.parse(localStorage.getItem("odoo"));
-
-        /**
-         * FIXME:
-         * 
-         * [x]  modificando el manejo de inicio de sesion de no guarda la informacion del usuario y contrasena
-         *      imposibilitando la sincronizacion de datos
-         */
-
-
-        console.log(loginInformation);
-
+        
         this.odoo.initialize(loginInformation.host);
         return this.odoo.login(loginInformation.database, loginInformation.username, loginInformation.password);
     }