|
|
@@ -25,7 +25,7 @@ export class LoginDataService {
|
|
|
private _connectionsServiece: ConnectionsService,
|
|
|
private _socketService: SocketService,
|
|
|
private _loginService: LoginService,
|
|
|
- private readonly geolocation$: GeolocationService,
|
|
|
+ private readonly _geolocation$: GeolocationService,
|
|
|
private _resourceService: ResourcesService,
|
|
|
private _geolocationService: Gservice,
|
|
|
) {
|
|
|
@@ -71,13 +71,6 @@ export class LoginDataService {
|
|
|
}
|
|
|
this._resourceService.openSnackBar('Ocurrió un error al validar el token');
|
|
|
return true;
|
|
|
- /*
|
|
|
- if(error.status == 500){
|
|
|
- this._resourceService.openSnackBar('Ocurrió un error al validar el token');
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return false;*/
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -102,15 +95,26 @@ export class LoginDataService {
|
|
|
}
|
|
|
|
|
|
logout () {
|
|
|
- this.geolocation$.pipe(take(1)).subscribe(position => {
|
|
|
+ let uriArr = window.location.href.split(':');
|
|
|
+ if(uriArr[0] == 'https'){
|
|
|
+ this._geolocation$.pipe(take(1)).subscribe(position => {
|
|
|
+ let userPosition: LoginPlace = {
|
|
|
+ latitude: position.coords.latitude,
|
|
|
+ longitude: position.coords.longitude,
|
|
|
+ accuracy: position.coords.accuracy
|
|
|
+ };
|
|
|
+
|
|
|
+ this.requestLogout(userPosition);
|
|
|
+ });
|
|
|
+ }else{
|
|
|
let userPosition: LoginPlace = {
|
|
|
- latitude: position.coords.latitude,
|
|
|
- longitude: position.coords.longitude,
|
|
|
- accuracy: position.coords.accuracy
|
|
|
+ latitude: 19.3477,
|
|
|
+ longitude: -99.1877,
|
|
|
+ accuracy: 169665
|
|
|
};
|
|
|
|
|
|
this.requestLogout(userPosition);
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
async requestLogout(position: LoginPlace){
|