What is the "token" returned by auth.api.signinEmail?

Hello, I use a custom endpoint for sign-in/email. The return of auth.api.signinEmail() is:
const result: {
redirect: boolean;
token: string;
url: string | undefined;
user: {
id: string;
email: string;
name: string;
image: string | null | undefined;
emailVerified: boolean;
createdAt: Date;
updatedAt: Date;
};
}
const result: {
redirect: boolean;
token: string;
url: string | undefined;
user: {
id: string;
email: string;
name: string;
image: string | null | undefined;
emailVerified: boolean;
createdAt: Date;
updatedAt: Date;
};
}
Do I have to return all to the front end for authClient, or is some data not intended for the front end? In particular, what is the token used for? Thank you
Solution:
you most likely don't need to return it but it's safe to return
Jump to solution
4 Replies
bekacru
bekacru2w ago
the session token
Solution
bekacru
bekacru2w ago
you most likely don't need to return it but it's safe to return
Nico64
Nico64OP2w ago
Ok thank you 👍 There's no need to return, because it's get-session that's called next?
bekacru
bekacru2w ago
yes

Did you find this page helpful?