Custom NbAuthStrategy getting result from async call
- Langage dominant
- TypeScript
- Étoiles
- 8.1k
- Forks
- 1.5k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I am creating my own authentication method. I have extended NbAuthStrategy and implemented method authenticate as shown below
```
@Injectable()
export class MyAuthStrategy extends NbAuthStrategy {
...
authenticate(user: UserData): Observable {
...
this.userService.getUser(userId, function(user: IUser) {
console.log("called back" + user); ////// ?????
});
...
}
...
}
```
the method is expected to return a Observable object.
When I do a memory authentication it works great, no issues.
The problem comes when I try to authenticate on an AWS Lambda by doing an async call. As the response is async, I cannot return Observable so I find this authentication mechanism only works for memory or synchronous calls.
How can I authenticate when validation is done on an async call?
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.