Open ID Connect

Handle ID Token#

You can use decodeIdToken() to decode ID Tokens. This does not validate them, though validation is rarely necessary assuming the ID Token is used immediately.

import { decodeIdToken } from "@lucia-auth/oauth";

const user = decodeIdToken<Claims>(idToken);
const { sub, email } = user;

type Claims = {
	email: string;
};