mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
fix: Login via email does not properly redirect to desktop app (#9440)
This commit is contained in:
@@ -87,9 +87,10 @@ router.post(
|
||||
);
|
||||
|
||||
const emailCallback = async (ctx: APIContext<T.EmailCallbackReq>) => {
|
||||
const token = ctx.input.query?.token || ctx.input.body?.token;
|
||||
const client = ctx.input.query?.client || ctx.input.body?.client;
|
||||
const follow = ctx.input.query?.follow || ctx.input.body?.follow;
|
||||
const { query, body } = ctx.input;
|
||||
const token = query?.token || body?.token;
|
||||
const client = query?.client || body?.client || Client.Web;
|
||||
const follow = query?.follow || body?.follow;
|
||||
|
||||
// The link in the email does not include the follow query param, this
|
||||
// is to help prevent anti-virus, and email clients from pre-fetching the link
|
||||
@@ -140,7 +141,7 @@ const emailCallback = async (ctx: APIContext<T.EmailCallbackReq>) => {
|
||||
team: user.team,
|
||||
isNewTeam: false,
|
||||
isNewUser: false,
|
||||
client: client ?? Client.Web,
|
||||
client,
|
||||
});
|
||||
};
|
||||
router.get("email.callback", validate(T.EmailCallbackSchema), emailCallback);
|
||||
|
||||
@@ -14,12 +14,12 @@ export type EmailReq = z.infer<typeof EmailSchema>;
|
||||
export const EmailCallbackSchema = BaseSchema.extend({
|
||||
query: z.object({
|
||||
token: z.string().optional(),
|
||||
client: z.nativeEnum(Client).default(Client.Web),
|
||||
client: z.nativeEnum(Client).optional(),
|
||||
follow: z.string().default(""),
|
||||
}),
|
||||
body: z.object({
|
||||
token: z.string().optional(),
|
||||
client: z.nativeEnum(Client).default(Client.Web),
|
||||
client: z.nativeEnum(Client).optional(),
|
||||
follow: z.string().default(""),
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user