JoelC
04/14/2022, 4:18 PMFrAgOrDiE
04/15/2022, 9:29 AMrp
04/15/2022, 9:43 AMkelbs
04/16/2022, 4:20 PMyiannis.gkoufas
04/16/2022, 5:59 PMNovyLevi
04/17/2022, 10:03 AMthirdPartySignInUpPOST
override?
I tried something like await verifySession({ sessionRequired: false })(input.options.req, input.options.res);
but that errors out.rp
04/17/2022, 10:20 AMInfatuation
04/17/2022, 4:04 PMhoward
04/17/2022, 5:43 PMInfatuation
04/17/2022, 6:31 PMITEnthusiasm
04/18/2022, 10:22 PMrequest
object? (Talking about Node.js
here.)
I'm playing around with Svelte Kit
. And it seems like they don't give us access to any data tacked onto the request object. I'm trying to figure out if there's a more functional way to get the session instead. 🤔rp
04/19/2022, 4:02 AMassafushy
04/19/2022, 6:07 AMPontus
04/19/2022, 4:11 PMPontus
04/19/2022, 4:12 PMrankala
04/19/2022, 5:36 PMError: Cannot find module 'faunadb'
. But i cant find anything related to faunadb
in the docsTELYA
04/19/2022, 11:47 PMtypescript
await EmailPasswordReact.signOut();
await EmailPasswordReact.redirectToAuth({ show: "signin" });
And it cleared all my cookies and redirected to the login page. It was pretty much it, but i noticed, that after i added a change password functionality to my site and after i successfully changed my password the EmailPasswordReact.signOut function call didn't cleared my cookies. I had to delete them manually then after a relogging, it worked just as before.
I checked my backend(Nest.js) code and it seems fine
typescript
@Post("/change-password")
@UseGuards(AuthGuard)
async changePassword(
@Session() session: SessionContainer,
@Body() changePasswordDto: ChangePasswordDto,
@Res() res: Response
) {
const { currentPassword, newPassword } = changePasswordDto;
const userId = session.getUserId();
const userInfo = await EmailPasswordNode.getUserById(userId);
if (userInfo === undefined) {
throw new Error("Should never come here");
}
const isPasswordValid = await EmailPasswordNode.signIn(userInfo.email, currentPassword);
if (isPasswordValid.status !== "OK") {
throw new BadRequestException("Hibás jelenlegi jelszó");
}
const response = await EmailPasswordNode.updateEmailOrPassword({
userId,
password: newPassword
}).catch((error) => {
console.log(error);
throw new InternalServerErrorException("Váratlan hiba");
});
if (response.status !== "OK") {
throw new InternalServerErrorException("Váratlan hiba");
}
await SupertokensSession.revokeAllSessionsForUser(userId);
await session.revokeSession();
return res.status(401);
}
Do you guys have any idea what i did wrong ?
Thanks for the answers in advance 🙂rp
04/20/2022, 3:42 AMfinthechat007
04/20/2022, 3:53 AMfinthechat007
04/20/2022, 3:54 AMshubham vora
04/20/2022, 5:38 AMrankala
04/20/2022, 8:20 AMSuperTokens.init
from import SuperTokens from 'supertokens-website';
a singelton? I want to use SuperTokens.doesSessionExist()
in an auth guard. The init
is in another service. with angualrrp
04/20/2022, 8:23 AMrankala
04/20/2022, 8:35 AMSuperTokens.doesSessionExist()
directly after the response, I should have a valid Session. thats not the case. Do I miss a step?scherbatsky.jr
04/20/2022, 11:05 AMITEnthusiasm
04/20/2022, 1:09 PMrp
04/20/2022, 1:30 PMFrAgOrDiE
04/20/2022, 1:48 PMpepegc
04/20/2022, 3:13 PMrp
04/20/2022, 3:24 PM