magic link sendMagicLink using astro request is undefined

Hi guys, Iam stuck for a while now. I dont understand when or why the Request is undefined. Email, token and url are getting printed but the request is always empty.
plugins: [
magicLink({
sendMagicLink: async ({ email, token, url }, request) => {
// send email to user
logger.info("sending magic link",` name: `, email, token, url);
logger.debug("request", request);
},
}),
],
plugins: [
magicLink({
sendMagicLink: async ({ email, token, url }, request) => {
// send email to user
logger.info("sending magic link",` name: `, email, token, url);
logger.debug("request", request);
},
}),
],
could this be related to astro ?
5 Replies
KHRM
KHRM6d ago
curious what do you need request for, I ended up using using just the email and URL for my needs
paul_11097
paul_11097OP6d ago
i want the user session because the email should been send with staff email
bekacru
bekacru6d ago
are you using the client sdk or auth.api?
paul_11097
paul_11097OP6d ago
iam using the client:
export async function inviteStartup(email: string): ErrorSafePromise<void> {
try {
console.log("start invite");
const { data, error } = await authClient.signIn.magicLink({
email: email,
callbackURL: "some/callback",
name: "test",
});
console.log("response", data?.status);
return [undefined, false];
} catch (err) {
return [null, true];
}
}
export async function inviteStartup(email: string): ErrorSafePromise<void> {
try {
console.log("start invite");
const { data, error } = await authClient.signIn.magicLink({
email: email,
callbackURL: "some/callback",
name: "test",
});
console.log("response", data?.status);
return [undefined, false];
} catch (err) {
return [null, true];
}
}
paul_11097
paul_11097OP6d ago
also the auth server object doesnt contain any magic link property
No description

Did you find this page helpful?