mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-31 15:09:39 +02:00
improve email formatting and invite flow for new users
This commit is contained in:
parent
d244d6003b
commit
d447de9e8a
15 changed files with 107 additions and 89 deletions
|
@ -12,6 +12,7 @@ import { fromError } from "zod-validation-error";
|
|||
import { isWithinExpirationDate } from "oslo";
|
||||
import { verifyPassword } from "@server/auth/password";
|
||||
import { checkValidInvite } from "@server/auth/checkValidInvite";
|
||||
import { verifySession } from "@server/auth";
|
||||
|
||||
const acceptInviteBodySchema = z
|
||||
.object({
|
||||
|
@ -72,7 +73,9 @@ export async function acceptInvite(
|
|||
);
|
||||
}
|
||||
|
||||
if (req.user && req.user.email !== existingInvite.email) {
|
||||
const { user, session } = await verifySession(req);
|
||||
|
||||
if (user && user.email !== existingInvite.email) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.BAD_REQUEST,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue