Auth Core
Types
Types
APITokenEnvironment
type APITokenEnvironment = "live" | "test"
JWTConfig
type JWTConfig = { privateKey: string; publicKey: string; accessTokenTTL: number; refreshTokenTTL: number; previousPublicKeys?: string[] | undefined; issuer?: string | undefined; }
Account
type Account = { id: string; domainId: string; createdAt: string; updatedAt: string; type: "oauth" | "oidc"; userId: string; provider: string; providerAccountId: string; refreshToken?: string | undefined; accessToken?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; scope?: string | undefined; idToken?: string | undefined; }
CreateAccount
type CreateAccount = { domainId: string; type: "oauth" | "oidc"; userId: string; provider: string; providerAccountId: string; id?: string | undefined; refreshToken?: string | undefined; accessToken?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; scope?: string | undefined; idToken?: string | undefined; }
DeviceInfo
type DeviceInfo = { userAgent: string; ip: string; deviceId: string; platform?: string | undefined; browser?: string | undefined; location?: string | undefined; }
Session
type Session = { id: string; domainId: string; createdAt: string; updatedAt: string; userId: string; expires: string; deviceInfo?: { userAgent: string; ip: string; deviceId: string; platform?: string | undefined; browser?: string | undefined; location?: string | undefined; } | undefined; }
CreateSession
type CreateSession = { id: string; domainId: string; userId: string; expires: string; deviceInfo?: { userAgent: string; ip: string; deviceId: string; platform?: string | undefined; browser?: string | undefined; location?: string | undefined; } | undefined; }
VerificationToken
type VerificationToken = { id: string; domainId: string; createdAt: string; type: "magic-link" | "email-code" | "sms-code"; expires: string; identifier: string; token: string; }
ServiceAccount
type ServiceAccount = { id: string; name: string; domainId: string; orgId: string; createdAt: string; updatedAt: string; trashed: boolean; createdBy: string; scopes: string[]; active: boolean; description?: string | undefined; }
ApiToken
type ApiToken = { id: string; name: string; domainId: string; orgId: string; createdAt: string; serviceAccountId: string; tokenHash: string; prefix: string; revoked: boolean; expiresAt?: string | undefined; lastUsedAt?: string | undefined; }
JWTClaims
type JWTClaims = { domainId: string; email: string; orgId: string; type: "access" | "refresh"; sub: string; iat: number; exp: number; roles?: string[] | undefined; }
AuthUser
type AuthUser = { id: string; domainId: string; email: string; orgId: string; createdAt: string; updatedAt: string; trashed: boolean; name?: string | undefined; emailVerified?: string | undefined; image?: string | undefined; }
CreateAuthUser
type CreateAuthUser = { domainId: string; email: string; orgId: string; trashed: boolean; id?: string | undefined; name?: string | undefined; emailVerified?: string | undefined; image?: string | undefined; }