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