mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-22 08:02:28 +00:00
Feat/new UI (#153)
* wip * feat: make forms functional * feat: finalize pages * chore: remove unused translations * feat: app context * feat: user context * feat: finalize username login * fix: use correct tab order in login form * feat: add oauth logic * chore: update readme and assets * chore: rename docs back to assets * feat: favicons * feat: custom background image config option * chore: add acknowledgements for background image * feat: sanitize redirect URL * feat: sanitize redirect URL on check * chore: fix dependabot config * refactor: bot suggestions * fix: correctly redirect to app and check for untrusted redirects * fix: run oauth auto redirect only when there is a redirect URI * refactor: change select color * fix: fix dockerfiles * fix: fix hook rendering * chore: remove translations cdn * chore: formatting * feat: validate api response against zod schema * fix: use axios error instead of generic error in login page
This commit is contained in:
@@ -8,6 +8,7 @@ export const appContextSchema = z.object({
|
||||
domain: z.string(),
|
||||
forgotPasswordMessage: z.string(),
|
||||
oauthAutoRedirect: z.enum(["none", "github", "google", "generic"]),
|
||||
backgroundImage: z.string(),
|
||||
});
|
||||
|
||||
export type AppContextSchemaType = z.infer<typeof appContextSchema>;
|
||||
export type AppContextSchema = z.infer<typeof appContextSchema>;
|
||||
|
||||
@@ -5,4 +5,4 @@ export const loginSchema = z.object({
|
||||
password: z.string(),
|
||||
});
|
||||
|
||||
export type LoginFormValues = z.infer<typeof loginSchema>;
|
||||
export type LoginSchema = z.infer<typeof loginSchema>;
|
||||
|
||||
7
frontend/src/schemas/totp-schema.ts
Normal file
7
frontend/src/schemas/totp-schema.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const totpSchema = z.object({
|
||||
code: z.string(),
|
||||
});
|
||||
|
||||
export type TotpSchema = z.infer<typeof totpSchema>;
|
||||
@@ -5,9 +5,9 @@ export const userContextSchema = z.object({
|
||||
username: z.string(),
|
||||
name: z.string(),
|
||||
email: z.string(),
|
||||
oauth: z.boolean(),
|
||||
provider: z.string(),
|
||||
oauth: z.boolean(),
|
||||
totpPending: z.boolean(),
|
||||
});
|
||||
|
||||
export type UserContextSchemaType = z.infer<typeof userContextSchema>;
|
||||
export type UserContextSchema = z.infer<typeof userContextSchema>;
|
||||
|
||||
Reference in New Issue
Block a user