Open decosvaldo opened 3 years ago
Don't know if this is the right place, but I got the messages after editing local-strategy.ts's verified function to:
async function verified(err: any, user?: any, info?: any) {
if (err) {
context.state.onyx.failureMessage = err //new
return self.funcs.error(err);
}
if (!user) {
context.state.onyx.failureMessage = info //new
return self.funcs.fail(info);
}
context.state.onyx.successMessage = info //new
await self.funcs.success(user, info);
}
Is this the right place to do it?
Hi everybody, I'm trying Onyx on my new Deno application. Thanks for the effort!
I'm using the "info" field to set information about authentication error. I was using it with Node/Passport so I can return an accurate message for the user. The thing is I don't know how to get this information after my authentication proccess.
If I try to define the options here:
await (await onyx.authenticate('local',{ successMessage:"success test", failureMessage:"failure test"}))(ctx)
I receive this error:
My strategy is bellow:
I want to use the text information sent on the third parameter of the done function and display it to the user after the await (await onyx.authenticate('local'))(ctx) call.
I'm not an expert so, what I am doing wrong?
Also, do you know when oauth strategies like Google will be available? Thanks