mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 18:54:22 -04:00
Implementing loggout
This commit is contained in:
parent
0991acac1b
commit
ec4978f9de
@ -100,12 +100,14 @@ export class AppModule
|
|||||||
const config: OpenIdConfiguration = {
|
const config: OpenIdConfiguration = {
|
||||||
stsServer: configResult.customConfig.stsServer,
|
stsServer: configResult.customConfig.stsServer,
|
||||||
redirect_url: "/",
|
redirect_url: "/",
|
||||||
|
post_logout_redirect_uri: "/logout",
|
||||||
client_id: 'kyoo.webapp',
|
client_id: 'kyoo.webapp',
|
||||||
response_type: "code",
|
response_type: "code",
|
||||||
scope: "openid profile kyoo.read offline_access",
|
scope: "openid profile kyoo.read offline_access",
|
||||||
silent_renew: true,
|
silent_renew: true,
|
||||||
silent_renew_url: "/silent",
|
silent_renew_url: "/silent",
|
||||||
use_refresh_token: true,
|
use_refresh_token: true,
|
||||||
|
start_checksession: true,
|
||||||
|
|
||||||
forbidden_route: '/Forbidden',
|
forbidden_route: '/Forbidden',
|
||||||
unauthorized_route: '/Unauthorized',
|
unauthorized_route: '/Unauthorized',
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {OidcSecurityService} from "angular-auth-oidc-client";
|
import {OidcSecurityService} from "angular-auth-oidc-client";
|
||||||
|
import {HttpClient} from "@angular/common/http";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@ -9,7 +10,7 @@ export class AuthService
|
|||||||
isAuthenticated: boolean;
|
isAuthenticated: boolean;
|
||||||
user: any;
|
user: any;
|
||||||
|
|
||||||
constructor(public oidcSecurityService: OidcSecurityService)
|
constructor(public oidcSecurityService: OidcSecurityService, private http: HttpClient)
|
||||||
{
|
{
|
||||||
if (this.oidcSecurityService.moduleSetup)
|
if (this.oidcSecurityService.moduleSetup)
|
||||||
this.authorizeCallback();
|
this.authorizeCallback();
|
||||||
@ -37,7 +38,10 @@ export class AuthService
|
|||||||
|
|
||||||
logout()
|
logout()
|
||||||
{
|
{
|
||||||
this.oidcSecurityService.logoff();
|
this.http.get("api/account/logout").subscribe(() =>
|
||||||
|
{
|
||||||
|
this.oidcSecurityService.logoff();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private authorizeCallback()
|
private authorizeCallback()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user