fix: ensure verification token has team before processing (#27139)

* ensure verification token has team before processing

* fix
This commit is contained in:
Anik Dhabal Babu
2026-01-22 14:59:53 +00:00
committed by GitHub
parent a823bd84a1
commit dc4404f88c
+11 -2
View File
@@ -156,9 +156,18 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
let username = guessUsernameFromEmail(verificationToken.identifier);
if (!verificationToken?.team) {
return {
redirect: {
permanent: false,
destination: `/auth/error?error=Verification Token is not associated with any team`,
},
} as const;
}
const tokenTeam = {
...verificationToken?.team,
metadata: teamMetadataSchema.parse(verificationToken?.team?.metadata),
...verificationToken.team,
metadata: teamMetadataSchema.parse(verificationToken.team.metadata ?? null),
};
const isATeamInOrganization = tokenTeam?.parentId !== null;