diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts
index a8c6414c..9a789654 100644
--- a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts
+++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts
@@ -99,9 +99,7 @@ test.describe('Doc Header', () => {
).toBeVisible();
await expect(
- page.getByText(
- `Are you sure you want to delete the document "${randomDoc}"?`,
- ),
+ page.getByText(`Are you sure you want to delete this document ?`),
).toBeVisible();
await page
diff --git a/src/frontend/apps/impress/src/cunningham/cunningham-style.css b/src/frontend/apps/impress/src/cunningham/cunningham-style.css
index 89751ee4..0cd47575 100644
--- a/src/frontend/apps/impress/src/cunningham/cunningham-style.css
+++ b/src/frontend/apps/impress/src/cunningham/cunningham-style.css
@@ -365,7 +365,8 @@ input:-webkit-autofill:focus {
}
.c__button--medium {
- padding: 0.9rem var(--c--theme--spacings--s);
+ height: auto;
+ min-height: var(--c--components--button--medium-height);
}
.c__button--small {
@@ -551,6 +552,8 @@ input:-webkit-autofill:focus {
.c__modal__close .c__button {
padding: 0 !important;
+ top: -0.65rem;
+ right: -0.65rem;
}
.c__modal--full .c__modal__content {
diff --git a/src/frontend/apps/impress/src/features/auth/components/Auth.tsx b/src/frontend/apps/impress/src/features/auth/components/Auth.tsx
index 73728786..7d47b9b1 100644
--- a/src/frontend/apps/impress/src/features/auth/components/Auth.tsx
+++ b/src/frontend/apps/impress/src/features/auth/components/Auth.tsx
@@ -5,6 +5,7 @@ import { PropsWithChildren } from 'react';
import { Box } from '@/components';
import { useAuth } from '../hooks';
+import { getAuthUrl } from '../utils';
export const Auth = ({ children }: PropsWithChildren) => {
const { isLoading, pathAllowed, isFetchedAfterMount, authenticated } =
@@ -19,6 +20,22 @@ export const Auth = ({ children }: PropsWithChildren) => {
);
}
+ /**
+ * If the user is authenticated and wanted initially to access a document,
+ * we redirect to the document page.
+ */
+ if (authenticated) {
+ const authUrl = getAuthUrl();
+ if (authUrl) {
+ void replace(authUrl);
+ return (
+
+
+
+ );
+ }
+ }
+
/**
* If the user is not authenticated and the path is not allowed, we redirect to the login page.
*/
diff --git a/src/frontend/apps/impress/src/features/auth/hooks/useAuth.tsx b/src/frontend/apps/impress/src/features/auth/hooks/useAuth.tsx
index a697a3cd..92fa8f15 100644
--- a/src/frontend/apps/impress/src/features/auth/hooks/useAuth.tsx
+++ b/src/frontend/apps/impress/src/features/auth/hooks/useAuth.tsx
@@ -2,13 +2,12 @@ import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { useAuthQuery } from '../api';
-import { getAuthUrl } from '../utils';
const regexpUrlsAuth = [/\/docs\/$/g, /\/docs$/g, /^\/$/g];
export const useAuth = () => {
const { data: user, ...authStates } = useAuthQuery();
- const { pathname, replace } = useRouter();
+ const { pathname } = useRouter();
const [pathAllowed, setPathAllowed] = useState(
!regexpUrlsAuth.some((regexp) => !!pathname.match(regexp)),
@@ -18,18 +17,6 @@ export const useAuth = () => {
setPathAllowed(!regexpUrlsAuth.some((regexp) => !!pathname.match(regexp)));
}, [pathname]);
- // Redirect to the path before login
- useEffect(() => {
- if (!user) {
- return;
- }
-
- const authUrl = getAuthUrl();
- if (authUrl) {
- void replace(authUrl);
- }
- }, [user, replace]);
-
return {
user,
authenticated: !!user && authStates.isSuccess,
diff --git a/src/frontend/apps/impress/src/features/auth/index.ts b/src/frontend/apps/impress/src/features/auth/index.ts
index e2501124..ec8b4043 100644
--- a/src/frontend/apps/impress/src/features/auth/index.ts
+++ b/src/frontend/apps/impress/src/features/auth/index.ts
@@ -1,4 +1,4 @@
-export * from './api/types';
+export * from './api';
export * from './components';
export * from './hooks';
export * from './utils';
diff --git a/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx b/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx
index 4a09c6a1..36b1c1e3 100644
--- a/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx
+++ b/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx
@@ -116,6 +116,8 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
handleTitleSubmit(event.target.textContent || '')
}
$color={colorsTokens()['greyscale-1000']}
+ $minHeight="40px"
+ $padding={{ right: 'big' }}
$css={css`
&[contenteditable='true']:empty:not(:focus):before {
content: '${untitledDocument}';
diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx b/src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx
index a3a134aa..38e6a2f3 100644
--- a/src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx
+++ b/src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx
@@ -87,9 +87,7 @@ export const ModalRemoveDoc = ({ onClose, doc }: ModalRemoveDocProps) => {
{!isError && (
- {t('Are you sure you want to delete the document "{{title}}"?', {
- title: doc.title,
- })}
+ {t('Are you sure you want to delete this document ?')}
)}
diff --git a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx
index 1462c16a..53862948 100644
--- a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx
+++ b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx
@@ -5,7 +5,7 @@ import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { Box, Text, TextErrors } from '@/components';
-import { setAuthUrl } from '@/features/auth';
+import { KEY_AUTH, setAuthUrl } from '@/features/auth';
import { DocEditor } from '@/features/docs/doc-editor';
import {
Doc,
@@ -110,6 +110,9 @@ const DocPage = ({ id }: DocProps) => {
}
if (error.status === 401) {
+ void queryClient.resetQueries({
+ queryKey: [KEY_AUTH],
+ });
setAuthUrl();
void replace(`/401`);
return null;