#auth is fing me up
1 messages · Page 1 of 1 (latest)
You can also place this inside your LocalAuthGuard to get more helpful explanation what went wrong:
handleRequest<TUser = any>(
err: any,
user: any,
info: any,
context: ExecutionContext,
status?: any,
): TUser {
console.log(err, user, info, status);
return super.handleRequest(err, user, info, context, status);
}
I've found this is a more concise version of that, @frail creek
handleRequest(...args: Parameters<InstanceType<ReturnType<typeof AuthGuard>>['handleRequest']> {
console.log(args);
return super.handleRequest(...args);
}
Making use of that Typescript magic
I was actually looking for this snippet the other day, remembering that you had posted some nice bit to help debug AuthGuard, but decided to spend unreasonable amount of time to figure it out myself instead of asking you 😁
Updated my notes for next time, thank you ❤️