Compare commits

..

8 Commits

Author SHA1 Message Date
Szilárd Dóró
220ae37aa7 Merge pull request #1491 from nhost/changeset-release/main
chore: update versions
2023-01-09 14:26:56 +01:00
github-actions[bot]
d07bf08e45 chore: update versions 2023-01-09 10:46:27 +00:00
Szilárd Dóró
f2183250d2 Merge pull request #1470 from nhost/fix(dashboard)/sign-out
fix(dashboard): Resetting the cache when signing out.
2023-01-09 11:44:48 +01:00
Szilárd Dóró
5f3f9390aa chore(dashboard): updated changeset 2023-01-09 09:42:36 +01:00
Guido Curcio
d0f8081101 new changeset 2023-01-05 23:16:09 -03:00
Guido Curcio
84ebfb79d0 reorder calls when signing out 2023-01-05 23:14:35 -03:00
Pilou
3c78d0ef46 Merge pull request #1476 from nhost/test/reset-password
test: add forgot password test
2023-01-05 17:07:47 +01:00
Pierre-Louis Mercereau
ad28bf2166 test: add forgot password test 2023-01-05 10:59:52 +01:00
5 changed files with 31 additions and 9 deletions

View File

@@ -1,5 +1,11 @@
# @nhost/dashboard
## 0.9.1
### Patch Changes
- d0f80811: fix(dashboard): don't show error when signing out the user
## 0.9.0
### Minor Changes

View File

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

View File

@@ -1,13 +1,11 @@
import { ChangePasswordModal } from '@/components/applications/ChangePasswordModal';
import { useWorkspaceContext } from '@/context/workspace-context';
import { useUserDataContext } from '@/context/workspace1-context';
import { Avatar } from '@/ui/Avatar';
import { Modal } from '@/ui/Modal';
import Button from '@/ui/v2/Button';
import { Dropdown, useDropdown } from '@/ui/v2/Dropdown';
import Text from '@/ui/v2/Text';
import { emptyWorkspace } from '@/utils/helpers';
import { nhost } from '@/utils/nhost';
import { useApolloClient } from '@apollo/client';
import { useUserData } from '@nhost/nextjs';
import Image from 'next/image';
import { useRouter } from 'next/router';
@@ -22,9 +20,8 @@ function AccountMenuContent({
}: AccountMenuContentProps) {
const user = useUserData();
const router = useRouter();
const client = useApolloClient();
const [clicked, setClicked] = useState(false);
const { setWorkspaceContext } = useWorkspaceContext();
const { setUserContext } = useUserDataContext();
const { handleClose } = useDropdown();
return (
@@ -34,10 +31,9 @@ function AccountMenuContent({
color="secondary"
className="absolute top-6 right-4 grid grid-flow-col items-center gap-1 self-start font-medium"
onClick={async () => {
setWorkspaceContext(emptyWorkspace());
setUserContext({ workspaces: [] });
nhost.auth.signOut();
router.push('/signin');
await nhost.auth.signOut();
await client.resetStore();
}}
aria-label="Sign Out"
>

View File

@@ -0,0 +1,19 @@
import { faker } from '@faker-js/faker'
context('Forgot password', () => {
it('should reset password', () => {
const email = faker.internet.email()
cy.signUpAndConfirmEmail(email)
cy.signOut()
cy.findByRole('button', { name: /Continue with email \+ password/i }).click()
cy.findByRole('button', { name: /Forgot Password?/i }).click()
cy.findByPlaceholderText('Email Address').type(email)
cy.findByRole('button', { name: /Reset your password/i }).click()
cy.confirmEmail(email)
cy.contains('Profile page')
})
})

View File

@@ -86,6 +86,7 @@ Cypress.Commands.add('confirmEmail', (email) => {
cy.mhGetMailsByRecipient(email)
.should('have.length', 1)
.then(([message]) => {
cy.mhDeleteAll()
cy.visit(message.Content.Headers['X-Link'][0])
cy.saveRefreshToken()
})