Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication fixes/improvements #3174

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

apedroferreira
Copy link
Member

  • Get rid of errors about failing to parse JSON in auth requests
  • Fix infinite refresh when signing out and redirecting to sign-in page
  • Polyfill crypto for Node 18 users
  • Remove some options from Google provider that ask the user for permissions every time they sign in

Closes #3172

@apedroferreira apedroferreira added the bug 🐛 Something doesn't work label Feb 6, 2024
@apedroferreira apedroferreira requested a review from a team February 6, 2024 18:09
@apedroferreira apedroferreira self-assigned this Feb 6, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 7, 2024
@@ -1627,7 +1627,12 @@ export default function ToolpadApp({ rootRef, basename, state }: ToolpadAppProps
(window as any).toggleDevtools = () => toggleDevtools();
}, [toggleDevtools]);

const authContext = useAuth({ dom, basename, isRenderedInCanvas: IS_RENDERED_IN_CANVAS });
const authContext = useAuth({
Copy link
Member

Choose a reason for hiding this comment

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

No need to pass this around anymore, can get it from context, see #3170

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 7, 2024
@@ -13,6 +13,8 @@ import { asyncHandler } from '../utils/express';
import { adaptRequestFromExpressToFetch } from './httpApiAdapters';
import type { ToolpadProject } from './localMode';

globalThis.crypto ??= (await import('node:crypto')) as Crypto;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I've added a comment too explaining why we have the polyfill 62ac5f3

@apedroferreira apedroferreira merged commit 79398e9 into mui:master Feb 7, 2024
11 checks passed
@apedroferreira apedroferreira deleted the authentication-fixes branch February 7, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doesn't work on node.js 18
2 participants