Commit 5ea932ab by Jonathan Reinink

Fix issue with "remember" boolean on login page

1 parent 9a01ae5e
Showing with 12 additions and 2 deletions
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="p-6 bg-indigo-800 min-h-screen flex justify-center items-center"> <div class="p-6 bg-indigo-800 min-h-screen flex justify-center items-center">
<div class="w-full max-w-md"> <div class="w-full max-w-md">
<logo class="block mx-auto w-full max-w-xs fill-white" height="50" /> <logo class="block mx-auto w-full max-w-xs fill-white" height="50" />
<form class="mt-8 bg-white rounded-lg shadow-xl overflow-hidden" @submit.prevent="form.post(route('login.attempt'))"> <form class="mt-8 bg-white rounded-lg shadow-xl overflow-hidden" @submit.prevent="submit">
<div class="px-10 py-12"> <div class="px-10 py-12">
<h1 class="text-center font-bold text-3xl">Welcome Back!</h1> <h1 class="text-center font-bold text-3xl">Welcome Back!</h1>
<div class="mx-auto mt-6 w-24 border-b-2" /> <div class="mx-auto mt-6 w-24 border-b-2" />
...@@ -39,9 +39,19 @@ export default { ...@@ -39,9 +39,19 @@ export default {
form: this.$inertia.form({ form: this.$inertia.form({
email: 'johndoe@example.com', email: 'johndoe@example.com',
password: 'secret', password: 'secret',
remember: null, remember: false,
}), }),
} }
}, },
methods: {
submit() {
this.form
.transform(data => ({
...data,
remember: data.remember ? 'on' : '',
}))
.post(this.route('login.attempt'))
},
},
} }
</script> </script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!