Hi i am using angularx-social-login of version 2.2.1 in Angular8 application. Here as google auth token expires by 1 hour, i have to call method for refresh token. I have been through many websites but not able to get solution. I have installed and declared in app module and now using in login component to get the auth token and email address, id from sign in google button click. But i am not getting how to call refresh method for expiration time near by. Please help.
HTML:
<button type="submit" class="btn btn-primary btn-block" (click)="signInWithGoogle()">Sign in with Google</button>
Ts:
public signInWithGoogle(): void {
let socialUser = this.oauthService.signIn(GoogleLoginProvider.PROVIDER_ID).then((userData) => {
if(userData.idToken){
} else {
alert('danger')
}
});
}
app.module.ts:
import { SocialLoginModule, AuthServiceConfig } from "angularx-social-login";
import { GoogleLoginProvider } from "angularx-social-login";
imports: [
SocialLoginModule
],
providers: [
{
provide: AuthServiceConfig,
useFactory: provideConfig
}],
let config = new AuthServiceConfig([
{
id: GoogleLoginProvider.PROVIDER_ID,
provider: new GoogleLoginProvider("1051927480520-u87cv859uap5e6t4r5f52mk96a8a6nhe.apps.googleusercontent.com")
},
]);
export function provideConfig() {
return config;
}
so from demo, i am able to get details of gmail account i choosed for, but token expires by an hour, i need to get refresh token before it expires. Please help