Compare commits

..

2 Commits

Author SHA1 Message Date
github-actions[bot]
1230081ce6 chore: update versions (#2640)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @nhost/dashboard@1.12.2

### Patch Changes

-   c195c51: fix: send email upon signin for unverified users

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-05 12:48:55 +01:00
Hassan Ben Jobrane
c195c517de fix: send email upon signin for unverified users (#2639) 2024-04-05 11:48:14 +01:00
3 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,11 @@
# @nhost/dashboard
## 1.12.2
### Patch Changes
- c195c51: fix: send email upon signin for unverified users
## 1.12.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "1.12.1",
"version": "1.12.2",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",

View File

@@ -8,7 +8,7 @@ import { Text } from '@/components/ui/v2/Text';
import { getToastStyleProps } from '@/utils/constants/settings';
import { yupResolver } from '@hookform/resolvers/yup';
import { styled } from '@mui/material';
import { useSignInEmailPassword } from '@nhost/nextjs';
import { useNhostClient, useSignInEmailPassword } from '@nhost/nextjs';
import { useRouter } from 'next/router';
import { useEffect, type ReactElement } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
@@ -30,8 +30,9 @@ const StyledInput = styled(Input)({
});
export default function EmailSignUpPage() {
const { signInEmailPassword, error } = useSignInEmailPassword();
const router = useRouter();
const nhost = useNhostClient();
const { signInEmailPassword, error } = useSignInEmailPassword();
const form = useForm<EmailSignUpFormValues>({
reValidateMode: 'onSubmit',
@@ -63,6 +64,7 @@ export default function EmailSignUpPage() {
);
if (needsEmailVerification) {
await nhost.auth.sendVerificationEmail({ email: email as string });
router.push(`/email/verify?email=${email}`);
}
} catch {
@@ -83,7 +85,7 @@ export default function EmailSignUpPage() {
Sign In
</Text>
<Box className="grid grid-flow-row gap-4 rounded-md border bg-transparent p-6 lg:p-12">
<Box className="grid grid-flow-row gap-4 p-6 bg-transparent border rounded-md lg:p-12">
<FormProvider {...form}>
<Form
onSubmit={handleSubmit}
@@ -123,7 +125,7 @@ export default function EmailSignUpPage() {
<NavLink
href="/reset-password"
color="white"
className="justify-self-start font-semibold"
className="font-semibold justify-self-start"
>
Forgot password?
</NavLink>
@@ -148,7 +150,7 @@ export default function EmailSignUpPage() {
</FormProvider>
</Box>
<Text color="secondary" className="text-center text-base lg:text-lg">
<Text color="secondary" className="text-base text-center lg:text-lg">
Don&apos;t have an account?{' '}
<NavLink href="/signup" color="white">
Sign Up