Commit edad46f4 authored by Thomas Frion's avatar Thomas Frion

[CLEAN] In the pghm module we add auth-service

parent 1c066444
......@@ -12,7 +12,6 @@ import { MapComponent } from './map/map.component';
import { SidebarLeftComponent } from './sidebar-left/sidebar-left.component';
import { LogoutComponent } from './logout/logout.component';
import { AuthService } from './services/auth.service';
import { AuthGuard } from './services/auth-guard.service';
import { PghmApiModule } from './pghm-api/pghm-api.module'
......@@ -35,7 +34,6 @@ import { PghmApiModule } from './pghm-api/pghm-api.module'
PghmApiModule
],
providers: [
AuthService,
AuthGuard,
],
bootstrap: [AppComponent]
......
......@@ -3,7 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms';
import { Router } from '@angular/router';
import { AuthService } from '../services/auth.service';
import { AuthService } from 'src/app/pghm-api/auth.service';
/**
* @AuthComponent:
......
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '../services/auth.service';
import { AuthService } from 'src/app/pghm-api/auth.service';
@Component({
selector: 'app-logout',
......
......@@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { HttpClient } from "@angular/common/http";
import * as L from 'leaflet';
import * as models from 'src/app/pghm-api/services/models/models';
import { ServiceService } from 'src/app/pghm-api/services/clients/service.service';
import * as models from 'src/app/pghm-api/api/models/models';
import { ServiceService } from 'src/app/pghm-api/api/clients/service.service';
import { AuthGuard } from '../services/auth-guard.service';
import { environment } from '../../environments/environment';
......
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { AuthComponent } from '../auth-component/auth-component.component';
import { environment } from '../../environments/environment';
import { CookieService } from './cookie.service';
import { TokenService } from 'src/app/pghm-api/services/clients/token.service';
import { Token } from 'src/app/pghm-api/services/models/token';
import { AuthComponent } from 'src/app/auth-component/auth-component.component';
import { environment } from 'src/environments/environment';
import { CookieService } from 'src/app/services/cookie.service';
import { TokenService } from './api/clients/token.service';
import { Token } from './api/models/token';
/**
* @Service :
*
......@@ -13,7 +13,9 @@ import { Token } from 'src/app/pghm-api/services/models/token';
* Get the JWT generated by the API and save it in localStorage.
* If the API returns an error, the service will show the error message on the login page.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AuthService {
private readonly tokenName = {
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ServiceService } from './services/clients/service.service'
import { TokenService } from './services/clients/token.service'
import { UnitService } from './services/clients/unit.service'
import { UserService } from './services/clients/user.service'
import { WebcamService } from './services/clients/webcam.service'
import { AuthService } from './auth.service'
import { ServiceService } from './api/clients/service.service'
import { TokenService } from './api/clients/token.service'
import { UnitService } from './api/clients/unit.service'
import { UserService } from './api/clients/user.service'
import { WebcamService } from './api/clients/webcam.service'
@NgModule({
declarations: [],
......@@ -13,6 +14,7 @@ import { WebcamService } from './services/clients/webcam.service'
CommonModule
],
providers: [
AuthService,
ServiceService,
TokenService,
UnitService,
......
......@@ -3,7 +3,7 @@ import { Observable } from 'rxjs-compat/Observable';
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from './auth.service';
import { AuthService } from 'src/app/pghm-api/auth.service';
/**
* @service
......
......@@ -3,7 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms';
import {Fonctionnalite} from './fonctionnalite';
import { environment } from '../../environments/environment';
import { Unit } from 'src/app/pghm-api/services/models/unit';
import { Unit } from 'src/app/pghm-api/api/models/unit';
/**
* @SidebarLeftComponent :
* Component for the side bar on the left of the screen
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment