Skip to content

Commit

Permalink
Resolve console error on signin (#8234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Calder committed Jan 9, 2023
1 parent c3eccb5 commit d074e42
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-wolves-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Export `next/head` for use in auth package
5 changes: 5 additions & 0 deletions .changeset/twenty-chefs-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/auth': patch
---

Resolve `loading Admin Metadata` and `<head> cannot appear as a child of <div>` errors on signin
5 changes: 3 additions & 2 deletions packages/auth/src/components/SigninContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { ReactNode } from 'react';

import { jsx, Box, Center, useTheme } from '@keystone-ui/core';
import { Head } from '@keystone-6/core/admin-ui/router';

type SigninContainerProps = {
children: ReactNode;
Expand All @@ -14,9 +15,9 @@ export const SigninContainer = ({ children, title }: SigninContainerProps) => {
const { colors, shadow } = useTheme();
return (
<div>
<head>
<Head>
<title>{title || 'Keystone'}</title>
</head>
</Head>
<Center
css={{
minWidth: '100vw',
Expand Down
1 change: 0 additions & 1 deletion packages/auth/src/pages/SigninPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export const SigninPage = ({
return;
}
reinitContext();
router.push(redirect);
}
}}
>
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/admin-ui/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ import { AnchorHTMLAttributes } from 'react';
export type LinkProps = NextLinkProps & AnchorHTMLAttributes<HTMLAnchorElement>;

export const Link = NextLink;

import NextHead from 'next/head';

export const Head = NextHead;

1 comment on commit d074e42

@vercel
Copy link

@vercel vercel bot commented on d074e42 Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.