capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!
MIT License
223 stars 106 forks source link

Ionic Angular Capacitor - Please help how to implement Refresh Token in HTTP Interceptor #204

Open xzetic opened 2 years ago

xzetic commented 2 years ago

Description

Is there a way to implement that OAuth2Client.refreshToken returning as promise into Angular HttpInterceptor where it will auto refresh the token when we received an API status reply of 401. The framework is Angular. Thank you!

Capacitor version:

Run npx cap doctor:

Installed Dependencies: @capacitor/core: 3.4.3 @capacitor/cli: 3.4.3 @capacitor/android: 3.4.3 @capacitor/ios: 3.4.3

Library version:

OAuth Provider:

Your Plugin Configuration

{
    // Replace this with your plugin configuration
}

Affected Platform(s):