-
Notifications
You must be signed in to change notification settings - Fork 0
feat(registry): add sign-up authentication blocks
#9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| "use client" | ||
|
|
||
| import Link from "next/link" | ||
| import { Input } from "@/components/ui/input" | ||
| import { Button } from "@/components/ui/button" | ||
| import { Field, FieldDescription, FieldGroup, FieldLabel } from "@/components/ui/field" | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" | ||
|
|
||
| export const SignUp = () => { | ||
| return ( | ||
| <Card className="max-w-lg px-6 py-8 sm:p-8 relative gap-6"> | ||
| <CardHeader className="text-center gap-6 p-0"> | ||
| <div className="flex flex-col gap-1"> | ||
| <CardTitle className="text-2xl font-medium text-card-foreground">Welcome to Aura Stack</CardTitle> | ||
| <CardDescription className="text-sm text-muted-foreground font-normal"> | ||
| Fill in the form below to create your account | ||
| </CardDescription> | ||
| </div> | ||
| </CardHeader> | ||
| <CardContent className="p-0"> | ||
| <form> | ||
| <FieldGroup className="gap-6"> | ||
| <div className="flex flex-col gap-4"> | ||
| <Field className="gap-1.5"> | ||
| <FieldLabel htmlFor="username" className="text-sm"> | ||
| Username | ||
| </FieldLabel> | ||
| <Input | ||
| id="username" | ||
| type="text" | ||
| name="username" | ||
| required | ||
| placeholder="johndoe" | ||
| aria-label="Username" | ||
| className="dark:bg-background h-9 shadow-xs" | ||
| /> | ||
| </Field> | ||
| <Field className="gap-1.5"> | ||
| <FieldLabel htmlFor="email" className="text-sm"> | ||
| </FieldLabel> | ||
| <Input | ||
| id="email" | ||
| type="email" | ||
| name="email" | ||
| required | ||
| placeholder="name@example.com" | ||
| aria-label="Email" | ||
| className="dark:bg-background h-9 shadow-xs" | ||
| /> | ||
| </Field> | ||
| <Field className="gap-1.5"> | ||
| <FieldLabel className="text-sm" htmlFor="password"> | ||
| Password | ||
| </FieldLabel> | ||
| <Input | ||
| id="password" | ||
| type="password" | ||
| name="password" | ||
| required | ||
| aria-label="Password" | ||
| className="dark:bg-background h-9 shadow-xs" | ||
| /> | ||
| </Field> | ||
| <Field className="gap-1.5"> | ||
| <FieldLabel className="text-sm" htmlFor="confirmPassword"> | ||
| Confirm Password | ||
| </FieldLabel> | ||
| <Input | ||
| id="confirmPassword" | ||
| type="password" | ||
| name="confirmPassword" | ||
| required | ||
| aria-label="Confirm Password" | ||
| className="dark:bg-background h-9 shadow-xs" | ||
| /> | ||
| </Field> | ||
| </div> | ||
| <Field className="gap-4"> | ||
| <Button type="submit" size="lg" className="rounded-lg h-10 hover:bg-primary/80 cursor-pointer"> | ||
| Create Account | ||
| </Button> | ||
| <FieldDescription className="px-6 text-center text-sm leading-snug"> | ||
| By creating an account, you agree to our <Link href="#">Terms of Service</Link> and{" "} | ||
| <Link href="#">Privacy Policy</Link>. | ||
| </FieldDescription> | ||
| <FieldDescription className="text-center text-sm font-normal text-muted-foreground"> | ||
| Already have an account?{" "} | ||
| <Link href="#" className="font-medium text-card-foreground"> | ||
| Sign in | ||
| </Link> | ||
| </FieldDescription> | ||
| </Field> | ||
| </FieldGroup> | ||
| </form> | ||
| </CardContent> | ||
| </Card> | ||
| ) | ||
| } | ||
|
|
||
| export default SignUp | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,101 @@ | ||||||
| "use client" | ||||||
|
|
||||||
| import { Link } from "react-router" | ||||||
| import { Input } from "@/components/ui/input" | ||||||
| import { Button } from "@/components/ui/button" | ||||||
| import { Field, FieldDescription, FieldGroup, FieldLabel } from "@/components/ui/field" | ||||||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" | ||||||
|
|
||||||
| export const SignUp = () => { | ||||||
| return ( | ||||||
| <Card className="max-w-lg px-6 py-8 sm:p-8 relative gap-6"> | ||||||
| <CardHeader className="text-center gap-6 p-0"> | ||||||
| <div className="flex flex-col gap-1"> | ||||||
| <CardTitle className="text-2xl font-medium text-card-foreground">Welcome to Aura Stack</CardTitle> | ||||||
| <CardDescription className="text-sm text-muted-foreground font-normal"> | ||||||
| Fill in the form below to create your account | ||||||
| </CardDescription> | ||||||
| </div> | ||||||
| </CardHeader> | ||||||
| <CardContent className="p-0"> | ||||||
| <form> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set explicit safe form submission behavior for password inputs. Line 21 currently relies on default form behavior ( 🔧 Suggested patch- <form>
+ <form method="post" onSubmit={(event) => event.preventDefault()}>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| <FieldGroup className="gap-6"> | ||||||
| <div className="flex flex-col gap-4"> | ||||||
| <Field className="gap-1.5"> | ||||||
| <FieldLabel htmlFor="username" className="text-sm"> | ||||||
| Username | ||||||
| </FieldLabel> | ||||||
| <Input | ||||||
| id="username" | ||||||
| type="text" | ||||||
| name="username" | ||||||
| required | ||||||
| placeholder="johndoe" | ||||||
| aria-label="Username" | ||||||
| className="dark:bg-background h-9 shadow-xs" | ||||||
| /> | ||||||
| </Field> | ||||||
| <Field className="gap-1.5"> | ||||||
| <FieldLabel htmlFor="email" className="text-sm"> | ||||||
| </FieldLabel> | ||||||
| <Input | ||||||
| id="email" | ||||||
| type="email" | ||||||
| name="email" | ||||||
| required | ||||||
| placeholder="name@example.com" | ||||||
| aria-label="Email" | ||||||
| className="dark:bg-background h-9 shadow-xs" | ||||||
| /> | ||||||
| </Field> | ||||||
| <Field className="gap-1.5"> | ||||||
| <FieldLabel className="text-sm" htmlFor="password"> | ||||||
| Password | ||||||
| </FieldLabel> | ||||||
| <Input | ||||||
| id="password" | ||||||
| type="password" | ||||||
| name="password" | ||||||
| required | ||||||
| aria-label="Password" | ||||||
| className="dark:bg-background h-9 shadow-xs" | ||||||
| /> | ||||||
| </Field> | ||||||
| <Field className="gap-1.5"> | ||||||
| <FieldLabel className="text-sm" htmlFor="confirmPassword"> | ||||||
| Confirm Password | ||||||
| </FieldLabel> | ||||||
| <Input | ||||||
| id="confirmPassword" | ||||||
| type="password" | ||||||
| name="confirmPassword" | ||||||
| required | ||||||
| aria-label="Confirm Password" | ||||||
| className="dark:bg-background h-9 shadow-xs" | ||||||
| /> | ||||||
| </Field> | ||||||
| </div> | ||||||
| <Field className="gap-4"> | ||||||
| <Button type="submit" size="lg" className="rounded-lg h-10 hover:bg-primary/80 cursor-pointer"> | ||||||
| Create Account | ||||||
| </Button> | ||||||
| <FieldDescription className="px-6 text-center text-sm leading-snug"> | ||||||
| By creating an account, you agree to our <Link to="#">Terms of Service</Link> and{" "} | ||||||
| <Link to="#">Privacy Policy</Link>. | ||||||
| </FieldDescription> | ||||||
| <FieldDescription className="text-center text-sm font-normal text-muted-foreground"> | ||||||
| Already have an account?{" "} | ||||||
| <Link to="#" className="font-medium text-card-foreground"> | ||||||
| Sign in | ||||||
| </Link> | ||||||
| </FieldDescription> | ||||||
| </Field> | ||||||
| </FieldGroup> | ||||||
| </form> | ||||||
| </CardContent> | ||||||
| </Card> | ||||||
| ) | ||||||
| } | ||||||
|
|
||||||
| export default SignUp | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent password values from being sent via URL on submit.
Line 21 uses a bare
<form>, which defaults toGET; submitting this form can exposepasswordandconfirmPasswordin query params.🔧 Suggested patch
📝 Committable suggestion
🤖 Prompt for AI Agents