mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
Dependency Updates
This commit is contained in:
parent
63146aa9b7
commit
8b7191ac26
5 changed files with 38 additions and 5 deletions
|
|
@ -17,6 +17,10 @@ export const RegisterForm = () => {
|
|||
|
||||
const validateForm = () => {
|
||||
if (!username || !password || !confpassword) {
|
||||
if(password !== confpassword){
|
||||
setError('Password and Confirm Password doesnt match');
|
||||
return false;
|
||||
}
|
||||
setError('Username and password are required');
|
||||
return false;
|
||||
}
|
||||
|
|
@ -65,6 +69,7 @@ export const RegisterForm = () => {
|
|||
}
|
||||
|
||||
} else {
|
||||
setLoading(false);
|
||||
setError('Recaptcha Failed');
|
||||
}
|
||||
}
|
||||
|
|
@ -82,9 +87,9 @@ export const RegisterForm = () => {
|
|||
</h1>
|
||||
<form className="space-y-4 md:space-y-6" onSubmit={handleSubmit}>
|
||||
<div>
|
||||
<label className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your email</label>
|
||||
<label className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Username</label>
|
||||
<input value={username}
|
||||
onChange={(e) => setUsername(e.target.value)} type="username" name="username" id="username" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="name@company.com" />
|
||||
onChange={(e) => setUsername(e.target.value)} type="username" name="username" id="username" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="username" />
|
||||
</div>
|
||||
<div>
|
||||
<label className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Password</label>
|
||||
|
|
@ -95,7 +100,7 @@ export const RegisterForm = () => {
|
|||
<label className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Confirm password</label>
|
||||
<input value={confpassword}
|
||||
onChange={(e) => setConfPassword(e.target.value)}
|
||||
type="confirm-password" name="confpassword" id="confpassword" placeholder="••••••••" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" />
|
||||
type="password" name="confpassword" id="confpassword" placeholder="••••••••" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" />
|
||||
</div>
|
||||
<ReCAPTCHA sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY!} className="mx-auto" onChange={setCaptcha} />
|
||||
<button type="submit" className="mt-4 w-full text-white bg-primary-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"> {loading ? 'Creating...' : 'Create Account'}</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue