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

feat: Add check for demoUser role on login #3872

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Oct 29, 2024

What does this PR do?

  • Adds a guard to control that users with the demoUser role cannot access production
  • Type tidy ups

Originally, we did consider reusing the is_staging_only column for this purpose. However, I think it's clearer and more meaningful to check the role and just follow the same pattern as opposed to repurposing the is_staging_only column.

@DafyddLlyr DafyddLlyr marked this pull request as draft October 29, 2024 15:37
Copy link

github-actions bot commented Oct 29, 2024

Removed vultr server and associated DNS entries

@DafyddLlyr DafyddLlyr changed the title feat: Add check for demoUser role on login feat: Add check for demoUser role on login Oct 30, 2024
@DafyddLlyr DafyddLlyr requested a review from a team October 30, 2024 08:18
@DafyddLlyr DafyddLlyr marked this pull request as ready for review October 30, 2024 09:24
@DafyddLlyr DafyddLlyr requested review from a team and removed request for a team October 30, 2024 09:25
const isStagingOnlyUser = await $api.user.isStagingOnly(user.email);
if (isStagingOnlyUser) return false;

return true;
Copy link
Member

Choose a reason for hiding this comment

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

👍

@DafyddLlyr DafyddLlyr merged commit 5ddc1c2 into main Oct 30, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/demo-user-api-login branch October 30, 2024 09:42
@RODO94
Copy link
Contributor

RODO94 commented Oct 30, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants