akveo / akveo/nebular

How use NbOAuth2AuthStrategy for login with Linkedin (3 steps)

オープン
#1,700 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
needs docs
主要言語
TypeScript
スター
8.1k
フォーク
1.5k
PR マージ指標
30日以内にマージされた PR はありません

説明

As we should proceed to make a login in 3 steps, for example in Linkedin, which first returns a code and then with that code we get the token, the problem I have is that I can not add that code to the parameters even if I put them so :

```TypeScript
export class LinkedinTokenComponent implements OnDestroy, OnInit{
alive = true;

constructor(private activatedRouter: ActivatedRoute, private authService: NbAuthService, private router: Router) { }

ngOnInit(): void {
const code = this.router.url.split('=')[1];
this.authService.authenticate('linkedinToken', { ['code'] : code })
.pipe(takeWhile(() => this.alive))
.subscribe((result: NbAuthResult) => {
if (result.isSuccess() && result.getRedirect()) {
this.router.navigateByUrl(result.getRedirect());
}
}
);
}
ngOnDestroy(): void {
this.alive = false;
}

}
```
in the other strategy:

```TypeScript
export class CallbackLinkedinComponent implements OnDestroy{
alive = true;

constructor(private authService: NbAuthService) {
this.authService.authenticate('linkedin');
}

ngOnDestroy(): void {
this.alive = false;
}

}
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。