feat(SW-160): update profile

This commit is contained in:
Simon Emanuelsson
2024-07-17 16:12:18 +02:00
committed by Michael Zetterberg
parent b6e22d51a5
commit 2337d37f1a
32 changed files with 459 additions and 244 deletions

View File

@@ -4,25 +4,31 @@ export type EditFormProps = {
user: User
}
type E = {
message: string
path: string
}
export const enum Status {
error = "error",
success = "success",
}
type ErrorState = {
errors?: E[]
type Data = Record<
string,
string | undefined | Record<string, string | undefined>
>
type Issue = {
field: string
message: string
status: Status.error
}
type SuccessState = {
export type State = {
data: Data
message: string
status: Status.success
}
export type State = ErrorState | SuccessState | null
} & (
| {
issues: never
status: Status.success
}
| {
issues: Issue[]
status: Status.error
}
)

4
types/jwt.d.ts vendored
View File

@@ -11,9 +11,9 @@ declare module "next-auth/jwt" {
interface JWT extends DefaultJWT, RefreshTokenError {
access_token: string
expires_at?: number
refresh_token: string
loginType: LoginType
mfa_scope: boolean
mfa_expires_at: number
mfa_scope: boolean
refresh_token: string
}
}