Hi,
In Angular, how to remove/change the post logout re-direct Url
oauth2/logout?post_logout_redirect_uri=""
Thanks
Hi,
In Angular, how to remove/change the post logout re-direct Url
oauth2/logout?post_logout_redirect_uri=""
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajkiran SwainRank #165 · 14.4K reputationPosted Apr 10, 2023, 12:28 PM EDT
Yes, you can configure the post-logout redirect URI in your Angular application's
app.module.tsfile.import { NgModule } from '@angular/core'; import { OAuthModule, OAuthStorage } from 'angular-oauth2-oidc'; @NgModule({ imports: [ OAuthModule.forRoot({ resourceServer: { allowedUrls: ['http://localhost:4200/api'], sendAccessToken: true }, logoutUrl: 'https://your-logout-url.com/logout', logoutUrlParams: { post_logout_redirect_uri: 'https://your-post-logout-url.com' }, storage: localStorage }) ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }Rajkiran SwainRank #165 · 14.4K reputationPosted Apr 10, 2023, 9:49 AM EDT
import { AuthConfig } from 'angular-oauth2-oidc'; const authConfig: AuthConfig = { // other config options... postLogoutRedirectUri: 'https://example.com/custom-logout-url', }; // initialize the OAuthService with the updated config this.oauthService.configure(authConfig);sathishRank #4,713 · 329 reputationPosted Apr 10, 2023, 11:08 AM EDT
Thanks Raj.
Do I need to try app.module.ts file for the re-direct.