typescript - AngularでNbAuthOAuth2Tokenからユーザーデータを取得する
私はこのように NbAuthOAuth2Token を使っています
this.authService.onTokenChange()
.pipe(takeUntil(this.destroy$))
.subscribe((token: NbAuthOAuth2Token) => {
this.token = null;
if (token && token.isValid()) {
this.token = token;
}
});
そして私のログイン関数ではこのように
login() {
this.authService.authenticate('google')
.pipe(takeUntil(this.destroy$))
.subscribe((authResult: NbAuthResult) => {
});
}
ユーザーデータを取得するにはどうすればいいですか?私は scope: 'https://www.googleapis.com/auth/userinfo.profile', を使用しています