Skip to content

Impersonation fix#4521

Merged
zomars merged 6 commits into
mainfrom
bug/impersonation-fix
Sep 17, 2022
Merged

Impersonation fix#4521
zomars merged 6 commits into
mainfrom
bug/impersonation-fix

Conversation

@sean-brydon
Copy link
Copy Markdown
Member

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Sep 17, 2022 at 9:13PM (UTC)

@sean-brydon sean-brydon requested a review from zomars September 16, 2022 09:26
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

The zod schema is a bit confusing

Comment thread packages/features/ee/impersonation/lib/ImpersonationProvider.ts Outdated
Comment thread packages/features/ee/impersonation/lib/ImpersonationProvider.ts Outdated
{
role: {
in: ["ADMIN", "OWNER"],
if (teamId) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prefer Early Returns

Suggested change
if (teamId) {
if (!teamId) throw new Error("You do not have permission to do this.");

@zomars zomars enabled auto-merge (squash) September 17, 2022 20:58
@zomars zomars merged commit 546d0d5 into main Sep 17, 2022
@zomars zomars deleted the bug/impersonation-fix branch September 17, 2022 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants