On angular using the package:
@abacritt/angularx-social-login
I am using version 2.0.0.
After successfully login in once using google login provider, I would like the browser to remember the login after refreshing or closing the browser.
I want to do it client side only. (unless it's not secure like that?)
I am guessing I should save the token as cookie on the browser or on local storage.
I am just not sure how to do it.
This is what I currently do:
import { SocialAuthService, SocialUser } from '@abacritt/angularx-social-login';
@Injectable({ providedIn: 'root' })
export class AuthService {
public user: SocialUser;
public loggedIn = false;
constructor(private authService: SocialAuthService) {
this.authService.authState.subscribe(async (user) => {
this.user = user;
this.loggedIn = user != null;
});
}
}
Which is just getting the user logged into.
I know it's a newbie answer but this is how I did it