@@ -43,7 +43,6 @@ export function LoginForm() {
4343 const [ loading , setLoading ] = useState ( false )
4444 const [ rememberMe , setRememberMe ] = useState ( false )
4545 const router = useRouter ( )
46- // No longer need the serverError state: const [serverError, setServerError] = useState('')
4746
4847 const form = useForm < z . infer < typeof formSchema > > ( {
4948 resolver : zodResolver ( formSchema ) ,
@@ -119,15 +118,18 @@ export function LoginForm() {
119118 render = { ( { field } ) => (
120119 < FormItem >
121120 < div className = "flex items-center" >
122- < FormLabel > Password</ FormLabel >
123- < Link href = "#" className = "ml-auto inline-block text-sm underline" >
124- Forgot your password?
121+ < FormLabel > Kata Sandi</ FormLabel >
122+ < Link
123+ href = "/auth/forgot-password"
124+ className = "ml-auto inline-block text-sm underline"
125+ >
126+ lupa kata sandi?
125127 </ Link >
126128 </ div >
127129 < FormControl >
128130 < Input type = "password" placeholder = "••••••••" { ...field } />
129131 </ FormControl >
130- < FormMessage /> { /* Server error messages will now appear here */ }
132+ < FormMessage />
131133 </ FormItem >
132134 ) }
133135 />
@@ -138,7 +140,7 @@ export function LoginForm() {
138140 checked = { rememberMe }
139141 onCheckedChange = { ( checked ) => setRememberMe ( Boolean ( checked ) ) }
140142 />
141- < Label htmlFor = "remember" > Remember me </ Label >
143+ < Label htmlFor = "remember" > Ingat Saya </ Label >
142144 </ div >
143145
144146 < Button type = "submit" className = "w-full" disabled = { loading } >
@@ -147,7 +149,6 @@ export function LoginForm() {
147149 </ form >
148150 </ Form >
149151 < div className = { cn ( 'w-full gap-2 flex items-center flex-col mt-4' ) } >
150- { /* ... Social login buttons remain the same ... */ }
151152 < Button
152153 variant = "outline"
153154 className = { cn ( 'w-full gap-2' ) }
@@ -182,18 +183,49 @@ export function LoginForm() {
182183 d = "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251"
183184 > </ path >
184185 </ svg >
185- Sign in with Google
186+ Masuk dengan Google
187+ </ Button >
188+
189+ < Button
190+ variant = "outline"
191+ className = { cn ( 'w-full gap-2' ) }
192+ disabled = { loading }
193+ onClick = { async ( ) => {
194+ await authClient . signIn . social (
195+ {
196+ provider : 'github' ,
197+ callbackURL : '/feeds' ,
198+ } ,
199+ {
200+ onRequest : ( ) => {
201+ setLoading ( true )
202+ } ,
203+ onResponse : ( ) => {
204+ setLoading ( false )
205+ } ,
206+ }
207+ )
208+ } }
209+ >
210+ < svg xmlns = "http://www.w3.org/2000/svg" width = "1em" height = "1em" viewBox = "0 0 24 24" >
211+ < path
212+ fill = "currentColor"
213+ d = "M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"
214+ > </ path >
215+ </ svg >
216+ Masuk dengan Github
186217 </ Button >
187218 </ div >
188219 </ CardContent >
189220 < CardFooter >
190221 < div className = "flex justify-center w-full border-t py-4" >
191- < p className = "text-center text-xs text-neutral-500" >
192- built with{ ' ' }
193- < Link href = "https://better-auth.com" className = "underline" target = "_blank" >
194- < span className = "dark:text-white/70 cursor-pointer" > better-auth.</ span >
195- </ Link >
196- </ p >
222+ < Link
223+ href = "/auth/register"
224+ className = "text-xs text-neutral-500 hover:text-primary transition-colors"
225+ target = "_blank"
226+ >
227+ Belum punya akun? < span className = "underline" > Daftar di sini.</ span >
228+ </ Link >
197229 </ div >
198230 </ CardFooter >
199231 </ Card >
0 commit comments