diff --git a/package-lock.json b/package-lock.json index 41fa513c..9be9e36a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2333,9 +2333,9 @@ "dev": true }, "angular-auth-oidc-client": { - "version": "10.0.15", - "resolved": "https://registry.npmjs.org/angular-auth-oidc-client/-/angular-auth-oidc-client-10.0.15.tgz", - "integrity": "sha512-DrYlR4TrnZX+Xr+Vnh1GlkiTmi7LDBnijEkW2NNgLfPp0D6T9ETtl4b2LgcGywLnpNRDBtaX7nOPY1GYL82bZw==", + "version": "10.0.14", + "resolved": "https://registry.npmjs.org/angular-auth-oidc-client/-/angular-auth-oidc-client-10.0.14.tgz", + "integrity": "sha512-+cHlEC3vleBpudNyJkjTV9CLc8+Mt7/MlGiTuE9Fn9gKkxOIQ0kcwyLfbnfCnbb9oGwcPvKhzNbqr4VyUYJMXQ==", "requires": { "common-tags": "1.8.0", "jsrsasign-reduced": "8.0.12", diff --git a/package.json b/package.json index a3bc9715..68cacf3e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@angular/platform-browser": "^9.1.0", "@angular/platform-browser-dynamic": "^9.1.0", "@angular/router": "^9.1.0", - "angular-auth-oidc-client": "^10.0.15", + "angular-auth-oidc-client": "10.0.14", "bootstrap": "^4.4.1", "detect-browser": "^5.0.0", "hammerjs": "^2.0.8", diff --git a/src/app/auth/account/account.component.html b/src/app/auth/account/account.component.html index 3f8337e4..18b2c21f 100644 --- a/src/app/auth/account/account.component.html +++ b/src/app/auth/account/account.component.html @@ -8,7 +8,7 @@
Username - +
diff --git a/src/app/auth/auth-routing.module.ts b/src/app/auth/auth-routing.module.ts index fd7f540e..34a22cb3 100644 --- a/src/app/auth/auth-routing.module.ts +++ b/src/app/auth/auth-routing.module.ts @@ -2,11 +2,9 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from "@angular/router"; import {UnauthorizedComponent} from "./unauthorized/unauthorized.component"; import {LogoutComponent} from "./logout/logout.component"; -import {AutologinComponent} from "./autologin/autologin.component"; const routes: Routes = [ {path: "logout", component: LogoutComponent}, - {path: "autologin", component: AutologinComponent}, {path: "unauthorized", component: UnauthorizedComponent}, ]; diff --git a/src/app/auth/auth.module.ts b/src/app/auth/auth.module.ts index 6fcb8e58..58aa5645 100644 --- a/src/app/auth/auth.module.ts +++ b/src/app/auth/auth.module.ts @@ -2,11 +2,10 @@ import {APP_INITIALIZER, NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {AccountComponent} from "./account/account.component"; import {AuthPipe} from "./misc/auth.pipe"; -import {AutologinComponent} from "./autologin/autologin.component"; import {UnauthorizedComponent} from "./unauthorized/unauthorized.component"; import {LogoutComponent} from "./logout/logout.component"; import {ConfigResult, OidcConfigService, OidcSecurityService, OpenIdConfiguration, AuthModule as OidcModule} from "angular-auth-oidc-client"; -import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from "@angular/common/http"; +import {HTTP_INTERCEPTORS, HttpClient} from "@angular/common/http"; import {AuthGuard} from "./misc/authenticated-guard.service"; import {AuthorizerInterceptor} from "./misc/authorizer-interceptor.service"; import {MatFormFieldModule} from "@angular/material/form-field"; @@ -20,7 +19,7 @@ import {MatSliderModule} from "@angular/material/slider"; import {MatTooltipModule} from "@angular/material/tooltip"; import {MatRippleModule} from "@angular/material/core"; import {MatCardModule} from "@angular/material/card"; -import {FormsModule, ReactiveFormsModule} from "@angular/forms"; +import {FormsModule} from "@angular/forms"; import {MatTabsModule} from "@angular/material/tabs"; import {MatCheckboxModule} from "@angular/material/checkbox"; @@ -31,7 +30,6 @@ export function loadConfig(oidcConfigService: OidcConfigService) @NgModule({ declarations: [ - AutologinComponent, AuthPipe, AccountComponent, UnauthorizedComponent, @@ -86,17 +84,17 @@ export class AuthModule post_logout_redirect_uri: "/logout", client_id: 'kyoo.webapp', response_type: "code", - trigger_authorization_result_event: true, + trigger_authorization_result_event: false, scope: "openid profile", silent_renew: true, - silent_renew_url: "/silent", + silent_renew_url: "/silent.html", use_refresh_token: false, start_checksession: true, forbidden_route: '/Forbidden', unauthorized_route: '/Unauthorized', log_console_warning_active: true, - log_console_debug_active: false + log_console_debug_active: true }; this.oidcSecurityService.setupModule(config, configResult.authWellknownEndpoints); diff --git a/src/app/auth/auth.service.ts b/src/app/auth/auth.service.ts index 739812a5..6d073a9e 100644 --- a/src/app/auth/auth.service.ts +++ b/src/app/auth/auth.service.ts @@ -62,13 +62,6 @@ export class AuthService this.oidcSecurityService.getIsAuthorized().subscribe((authorized: boolean) => { this.isAuthenticated = authorized; - if (!authorized) - { - if (document.cookie.indexOf("Authenticated=true") != -1) - this.router.navigate(['/autologin']); - } - else - document.cookie = "Authenticated=true; expires=" + new Date(2147483647 * 1000).toUTCString(); }); } } diff --git a/src/app/auth/autologin/autologin.component.html b/src/app/auth/autologin/autologin.component.html deleted file mode 100644 index 849245e8..00000000 --- a/src/app/auth/autologin/autologin.component.html +++ /dev/null @@ -1 +0,0 @@ -

autologin works!

diff --git a/src/app/auth/autologin/autologin.component.scss b/src/app/auth/autologin/autologin.component.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/auth/autologin/autologin.component.ts b/src/app/auth/autologin/autologin.component.ts deleted file mode 100644 index a019789e..00000000 --- a/src/app/auth/autologin/autologin.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {Component, OnInit} from '@angular/core'; -import {AuthService} from "../auth.service"; - -@Component({ - selector: 'app-autologin', - templateUrl: './autologin.component.html', - styleUrls: ['./autologin.component.scss'] -}) -export class AutologinComponent implements OnInit -{ - constructor(private authManager: AuthService) - { - this.authManager.oidcSecurityService.onModuleSetup.subscribe(() => - { - this.authManager.login(); - }) - } - - ngOnInit(): void - { - if (this.authManager.oidcSecurityService.moduleSetup) { - this.authManager.login(); - } - } -} diff --git a/src/assets/.gitkeep b/src/assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/assets/silent.html b/static/silent.html similarity index 100% rename from src/assets/silent.html rename to static/silent.html