MNTOR-2938 exposed that we are not consistently passing `authOptions`… (#4205)
* MNTOR-2938 exposed that we are not consistently passing `authOptions` to `getServerSession` This returns an incomplete `session` object. * check fxa uid for consistency
This commit is contained in:
Родитель
6c196f57ee
Коммит
5444565acb
|
@ -22,6 +22,7 @@ import { sendVerificationEmail } from "../../../../../../api/utils/email";
|
|||
import { getL10n } from "../../../../../../functions/server/l10n";
|
||||
import { logger } from "../../../../../../functions/server/logging";
|
||||
import { CONST_MAX_NUM_ADDRESSES } from "../../../../../../../constants";
|
||||
import { authOptions } from "../../../../../../api/utils/auth";
|
||||
|
||||
export type AddEmailFormState =
|
||||
| { success?: never }
|
||||
|
@ -37,7 +38,7 @@ export async function onAddEmail(
|
|||
formData: FormData,
|
||||
): Promise<AddEmailFormState> {
|
||||
const l10n = getL10n();
|
||||
const session = await getServerSession();
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session?.user.subscriber?.fxa_uid) {
|
||||
return {
|
||||
success: false,
|
||||
|
|
|
@ -14,10 +14,11 @@ import {
|
|||
import { getEnabledFeatureFlags } from "../../../../db/tables/featureFlags";
|
||||
import { getL10n } from "../../../functions/server/l10n";
|
||||
import { View } from "./LandingView";
|
||||
import { authOptions } from "../../../api/utils/auth";
|
||||
|
||||
export default async function Page() {
|
||||
const session = await getServerSession();
|
||||
if (typeof session?.user.email === "string") {
|
||||
const session = await getServerSession(authOptions);
|
||||
if (typeof session?.user.subscriber?.fxa_uid === "string") {
|
||||
return redirect("/user/dashboard/");
|
||||
}
|
||||
const enabledFlags = await getEnabledFeatureFlags({ ignoreAllowlist: true });
|
||||
|
|
Загрузка…
Ссылка в новой задаче