{"version":3,"file":"ng-vagabond-lab-ng-dsv-modules-auth.mjs","sources":["../../../projects/ng-dsv/modules/auth/component/auth.component.ts","../../../projects/ng-dsv/modules/auth/component/auth.component.html","../../../projects/ng-dsv/modules/auth/guard/auth.guard.ts","../../../projects/ng-dsv/modules/auth/interceptor/auth.interceptor.ts","../../../projects/ng-dsv/modules/auth/service/auth.service.ts","../../../projects/ng-dsv/modules/auth/service/auth.google.service.ts","../../../projects/ng-dsv/modules/auth/utils/auth.utils.ts","../../../projects/ng-dsv/modules/auth/ng-vagabond-lab-ng-dsv-modules-auth.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, effect, inject, output, signal } from '@angular/core';\nimport { ID } from '@ng-vagabond-lab/ng-dsv/api';\nimport { ModalAlertComponent, ModalButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/modal';\nimport { AuthGoogleService, AuthService } from '../public-api';\n\n@Component({\n    selector: 'dsv-auth',\n    imports: [CommonModule, ModalButtonComponent, ModalAlertComponent],\n    templateUrl: './auth.component.html',\n    styleUrls: ['./auth.component.scss'],\n})\nexport class AuthComponent {\n    readonly authService = inject(AuthService);\n    readonly authGoogleService = inject(AuthGoogleService);\n\n    callbackInitMember = output<ID>();\n    callbackLogout = output<void>();\n\n    initAuth = signal<boolean>(false);\n\n    constructor() {\n        effect(() => {\n            if (this.authService.apiService.isPlatformBrowser() && !this.initAuth()) {\n                this.initAuth.set(true);\n                this.authGoogleService.initGoogleAuth();\n                this.authService.refreshToken();\n            }\n        });\n        effect(() => {\n            if (this.authService.apiService.isPlatformBrowser()) {\n                if (this.authService.userConnected() === null) {\n                    this.authGoogleService.loginWithGoogle();\n                } else {\n                    this.callbackInitMember.emit(this.authService.userConnected()?.id);\n                }\n            }\n        });\n    }\n\n    logout() {\n        this.authService.logout();\n        this.callbackLogout.emit();\n    }\n}\n","<div class=\"auth-button\">\n    <button\n        id=\"google-signin-button\"\n        [class.hidden]=\"!authService.loadRefreshToken() || authService.userConnected() !== null\"\n    ></button>\n</div>\n\n@if (authService.userConnected()) {\n    <div class=\"profile\">\n        <img\n            [src]=\"authService.userConnected()?.avatar\"\n            alt=\"profile\"\n        />\n        <dsv-modal-button\n            id=\"logout\"\n            icon=\"ri-logout-box-line\"\n        />\n    </div>\n    <dsv-modal-alert\n        id=\"logout\"\n        titleText=\"Déconnexion\"\n        text=\"Voulez-vous vraiment vous déconnecter ?\"\n        button=\"Oui\"\n        buttonClose=\"Non\"\n        (callback)=\"logout()\"\n    ></dsv-modal-alert>\n}\n","import { inject } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { ActivatedRouteSnapshot, CanActivateFn, Router } from '@angular/router';\nimport { PlatformService } from '@ng-vagabond-lab/ng-dsv/platform';\nimport { filter, map, of, take, tap, timeout } from 'rxjs';\nimport { AuthService, hasRole } from '../public-api';\n\nexport const authGuard: CanActivateFn = (route: ActivatedRouteSnapshot) => {\n    const platformService = inject(PlatformService);\n\n    if (!platformService.isPlatformBrowser()) {\n        return true;\n    }\n\n    const authService = inject(AuthService);\n    const router = inject(Router);\n\n    const requiredRole = route.data['role'];\n\n    if (!requiredRole) {\n        console.warn('No role specified in route data.');\n        return false;\n    }\n\n    return toObservable(authService.userConnected).pipe(\n        filter((user) => user !== null),\n        take(1),\n        map((user) => hasRole(requiredRole, user?.profiles)),\n        tap((hasRole) => {\n            if (!hasRole) {\n                router.navigate(['/']);\n            }\n        }),\n        timeout({\n            each: 500,\n            with: () => {\n                router.navigate(['/']);\n                return of(false);\n            },\n        }),\n    );\n};\n","import { HttpClient, HttpErrorResponse, HttpHandlerFn, HttpRequest } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { ToastService } from '@ng-vagabond-lab/ng-dsv/ds/toast';\nimport { catchError, switchMap, throwError } from 'rxjs';\nimport { AuthService } from '../public-api';\n\nexport const authInterceptor = (req: HttpRequest<unknown>, next: HttpHandlerFn) => {\n    const httpClient = inject(HttpClient);\n    const authService = inject(AuthService);\n    const toastService = inject(ToastService);\n\n    return next(getToken(req, authService)).pipe(\n        catchError((error) => {\n            if (\n                error instanceof HttpErrorResponse &&\n                !req.url.includes('auth/') &&\n                req.url.includes(authService.apiService.baseUrl) &&\n                error.status === 401\n            ) {\n                return handle401Error(httpClient, authService, req, next);\n            }\n\n            let errorMessage = error.error.debugMessage ?? error.error.message ?? error.message;\n\n            if (errorMessage === 'fetch failed' || errorMessage === 'Failed to fetch') {\n                errorMessage = 'Api indisponible';\n            }\n            if (errorMessage === 'NO_REFRESH_TOKEN') {\n                authService.logout(false);\n            } else {\n                toastService.showToast({\n                    type: 'error',\n                    text: errorMessage,\n                });\n            }\n\n            return throwError(() => error);\n        }),\n    );\n};\n\nconst getToken = <T>(req: HttpRequest<T>, authService: AuthService) => {\n    const jwt = authService.userToken();\n    if (!req.url.includes('/auth/') && req.url.includes(authService.apiService.baseUrl) && jwt) {\n        const headers = req.headers.set('Authorization', `Bearer ${jwt}`);\n\n        return req.clone({\n            headers,\n        });\n    }\n    return req;\n};\n\nconst handle401Error = <T>(\n    httpClient: HttpClient,\n    authService: AuthService,\n    request: HttpRequest<T>,\n    next: HttpHandlerFn,\n) => {\n    return httpClient\n        .post(authService.apiService.baseUrl + '/auth/refresh-token', {}, { withCredentials: true })\n        .pipe(\n            switchMap((response) => {\n                authService.initUser(response);\n                return next(getToken(request, authService));\n            }),\n        );\n};\n","import { inject, Injectable, signal } from '@angular/core';\nimport { ApiService, JSONValue } from '@ng-vagabond-lab/ng-dsv/api';\nimport { UserDto, UserSigninDto } from '../dto/user.dto';\n\n@Injectable({\n    providedIn: 'root',\n})\nexport class AuthService {\n    readonly apiService = inject(ApiService);\n\n    userConnected = signal<UserDto | null>(null);\n    userToken = signal<string>('');\n    loadRefreshToken = signal<boolean>(false);\n\n    initUser(user: UserSigninDto | null = null) {\n        this.userConnected.set(user?.user ?? null);\n        this.userToken.set(user?.jwt ?? '');\n        this.loadRefreshToken.set(true);\n    }\n\n    googleLogin(credential: string) {\n        this.apiService.post<JSONValue, UserSigninDto>(\n            '/auth/google-identity-connect',\n            {\n                googleToken: credential,\n            },\n            (data) => {\n                this.initUser(data);\n                this.apiService.toastService.showToast({\n                    type: 'success',\n                    text: 'Connexion réussie',\n                });\n            },\n            true,\n        );\n    }\n\n    refreshToken() {\n        this.apiService.post<UserSigninDto>(\n            '/auth/refresh-token',\n            {},\n            (data) => this.initUser(data),\n            true,\n            () => this.initUser(),\n        );\n    }\n\n    logout(showToast: boolean = true) {\n        this.apiService.post<UserSigninDto>(\n            '/auth/logout',\n            {},\n            () => {\n                this.initUser();\n                if (showToast) {\n                    this.apiService.toastService.showToast({\n                        type: 'success',\n                        text: 'Déconnexion réussie',\n                    });\n                }\n            },\n            true,\n        );\n    }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { EnvironmentService } from '@ng-vagabond-lab/ng-dsv/environment';\nimport { AuthService } from './auth.service';\n\ndeclare const google: any;\n\n@Injectable({\n    providedIn: 'root',\n})\nexport class AuthGoogleService {\n    readonly authService = inject(AuthService);\n    readonly environmentService = inject(EnvironmentService);\n\n    initGoogleAuth(googleButtonid: string = 'google-signin-button') {\n        google.accounts.id.initialize({\n            client_id: this.environmentService.env()?.GOOGLE_CLIENT_ID,\n            callback: this.handleCredentialResponse.bind(this),\n        });\n        google.accounts.id.renderButton(document.getElementById(googleButtonid)!, {\n            theme: 'outline',\n            size: 'medium',\n            type: 'icon',\n        });\n    }\n\n    handleCredentialResponse(response: { credential: string }) {\n        this.authService.googleLogin(response.credential);\n    }\n\n    loginWithGoogle() {\n        if (this.authService.loadRefreshToken() && this.authService.userConnected() === null) {\n            google.accounts.id.prompt();\n        }\n    }\n}\n","import { ApiDto } from '@ng-vagabond-lab/ng-dsv/api';\n\nexport const hasRole = (roles: string, userRoles?: ApiDto[]) => {\n    const roleSplit = roles.split(',');\n    let find = false;\n    roleSplit.forEach((role) => {\n        if (\n            userRoles?.find(\n                (userRole) =>\n                    userRole['roles' as keyof ApiDto]?.toString().includes(role) ||\n                    userRole['name' as keyof ApiDto] === role,\n            )\n        ) {\n            find = true;\n        }\n    });\n    return find;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAYa,aAAa,CAAA;AACb,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAEtD,kBAAkB,GAAG,MAAM,EAAM;IACjC,cAAc,GAAG,MAAM,EAAQ;AAE/B,IAAA,QAAQ,GAAG,MAAM,CAAU,KAAK,+EAAC;AAEjC,IAAA,WAAA,GAAA;QACI,MAAM,CAAC,MAAK;AACR,YAAA,IAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;AACrE,gBAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACvB,gBAAA,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE;AACvC,gBAAA,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE;YACnC;AACJ,QAAA,CAAC,CAAC;QACF,MAAM,CAAC,MAAK;YACR,IAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,iBAAiB,EAAE,EAAE;gBACjD,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;AAC3C,oBAAA,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE;gBAC5C;qBAAO;AACH,oBAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,EAAE,EAAE,CAAC;gBACtE;YACJ;AACJ,QAAA,CAAC,CAAC;IACN;IAEA,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;AACzB,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE;IAC9B;uGA/BS,aA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