update id

This commit is contained in:
2025-11-07 16:09:01 -03:00
parent c8b4d9beeb
commit 4c50692cd9
27 changed files with 210 additions and 517 deletions

View File

@@ -6,8 +6,8 @@ import { useForm } from 'react-hook-form'
import { Link } from 'react-router'
import { z } from 'zod'
import logo from '@/components/logo.svg'
import { Button } from '@/components/ui/button'
import logo from '@repo/ui/components/logo2.svg'
import { Button } from '@repo/ui/components/ui/button'
import {
Form,
FormControl,
@@ -15,8 +15,8 @@ import {
FormItem,
FormLabel,
FormMessage
} from '@/components/ui/form'
import { Input } from '@/components/ui/input'
} from '@repo/ui/components/ui/form'
import { Input } from '@repo/ui/components/ui/input'
const schema = z.object({
username: z
@@ -50,7 +50,7 @@ export default function Forgot({}: Route.ComponentProps) {
return (
<>
<div className="w-full max-w-xs grid gap-6">
<div className="space-y-6">
<div className="flex justify-center">
<div className="border border-white/15 bg-white/5 px-2.5 py-3 rounded-xl">
<img src={logo} alt="EDUSEG®" className="block size-12" />
@@ -90,7 +90,7 @@ export default function Forgot({}: Route.ComponentProps) {
<Button
type="submit"
className="w-full bg-lime-400 cursor-pointer"
className="w-full cursor-pointer"
disabled={formState.isSubmitting}
>
Enviar instruções

View File

@@ -8,9 +8,9 @@ import { useForm } from 'react-hook-form'
import { Link, useFetcher } from 'react-router'
import { z } from 'zod'
import logo from '@/components/logo.svg'
import { Button } from '@/components/ui/button'
import { Checkbox } from '@/components/ui/checkbox'
import logo from '@repo/ui/components/logo2.svg'
import { Button } from '@repo/ui/components/ui/button'
import { Checkbox } from '@repo/ui/components/ui/checkbox'
import {
Form,
FormControl,
@@ -18,9 +18,9 @@ import {
FormItem,
FormLabel,
FormMessage
} from '@/components/ui/form'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
} from '@repo/ui/components/ui/form'
import { Input } from '@repo/ui/components/ui/input'
import { Label } from '@repo/ui/components/ui/label'
import { FOUND, INTERNAL_SERVER_ERROR, OK } from './authorize'
const schema = z.object({
@@ -118,7 +118,7 @@ export default function Index({}: Route.ComponentProps) {
return (
<>
<div className="w-full max-w-xs grid gap-6">
<div className="space-y-6">
<div className="flex justify-center">
<div className="border border-white/15 bg-white/5 px-2.5 py-3 rounded-xl">
<img src={logo} alt="EDUSEG®" className="block size-12" />
@@ -200,7 +200,7 @@ export default function Index({}: Route.ComponentProps) {
<Button
type="submit"
className="w-full bg-lime-400 cursor-pointer"
className="w-full cursor-pointer"
disabled={formState.isSubmitting}
>
{formState.isSubmitting && (

View File

@@ -11,7 +11,7 @@ export default function Layout() {
<ChevronLeftIcon className="size-5" /> Página inicial
</a>
<div className="w-full max-w-sm relative z-1">
<div className="w-full max-w-xs relative z-1 max-lg:mt-8">
<Outlet />
</div>

View File

@@ -1,13 +1,15 @@
import type { Route } from './+types'
import { isValidCPF } from '@brazilian-utils/brazilian-utils'
import { zodResolver } from '@hookform/resolvers/zod'
import { useState } from 'react'
import { useForm } from 'react-hook-form'
import { Link } from 'react-router'
import { z } from 'zod'
import logo from '@/components/logo.svg'
import { Button } from '@/components/ui/button'
import { Checkbox } from '@/components/ui/checkbox'
import logo from '@repo/ui/components/logo2.svg'
import { Button } from '@repo/ui/components/ui/button'
import { Checkbox } from '@repo/ui/components/ui/checkbox'
import {
Form,
FormControl,
@@ -15,11 +17,9 @@ import {
FormItem,
FormLabel,
FormMessage
} from '@/components/ui/form'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { isValidCPF } from '@brazilian-utils/brazilian-utils'
import { zodResolver } from '@hookform/resolvers/zod'
} from '@repo/ui/components/ui/form'
import { Input } from '@repo/ui/components/ui/input'
import { Label } from '@repo/ui/components/ui/label'
const schema = z.object({
name: z.string().trim().nonempty('Digite seu nome'),
@@ -53,7 +53,7 @@ export default function Signup({}: Route.ComponentProps) {
return (
<>
<div className="w-full max-w-xs grid gap-6">
<div className="space-y-6">
<div className="flex justify-center">
<div className="border border-white/15 bg-white/5 px-2.5 py-3 rounded-xl">
<img src={logo} alt="EDUSEG®" className="block size-12" />
@@ -148,7 +148,7 @@ export default function Signup({}: Route.ComponentProps) {
<Button
type="submit"
className="w-full bg-lime-400 cursor-pointer"
className="w-full cursor-pointer"
disabled={formState.isSubmitting}
>
Criar conta

View File

@@ -3,6 +3,8 @@ import type { Route } from './+types'
export const loader = proxy
export const action = proxy
const maxAge = 3600 * 8 // 8 hours
async function proxy({
request,
context
@@ -10,6 +12,20 @@ async function proxy({
const pathname = new URL(request.url).pathname
const url = new URL(pathname, context.cloudflare.env.ISSUER_URL)
const headers = new Headers(request.headers)
const shouldCache =
request.method === 'GET' && pathname.startsWith('/.well-known/')
const cache = caches.default
const cacheKey = new Request(url.toString(), request)
if (shouldCache) {
const cached = await cache.match(cacheKey)
if (cached) {
return cached
}
}
const response = await fetch(url.toString(), {
method: request.method,
headers,
@@ -18,14 +34,29 @@ async function proxy({
: { body: await request.text() })
})
const contentType = response.headers.get('content-type') || ''
const body =
contentType.includes('application/json') || contentType.startsWith('text/')
? await response.text()
: await response.arrayBuffer()
if (shouldCache && response.ok) {
const headers_ = new Headers(response.headers)
headers_.set('Cache-Control', `public, max-age=${maxAge}`)
return new Response(body, {
status: response.status,
headers: response.headers
})
const cacheResponse = new Response(response.clone().body, {
status: response.status,
headers: headers_
})
// Store asynchronously (dont block response)
context.cloudflare.ctx.waitUntil(cache.put(cacheKey, cacheResponse))
}
const contentType = response.headers.get('content-type') || ''
if (
contentType.includes('application/json') ||
contentType.startsWith('text/')
) {
return new Response(await response.text(), {
status: response.status,
headers: response.headers
})
}
return response
}