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

Augment session wrapper SSR #4223

Merged
merged 6 commits into from
Mar 8, 2024
Merged

Augment session wrapper SSR #4223

merged 6 commits into from
Mar 8, 2024

Conversation

flvndvd
Copy link
Contributor

@flvndvd flvndvd commented Mar 8, 2024

Description

This PR improves the wrapper introduced in to go one step further and create the authenticator object needed to check and access resources.

This PR enhances the SSR wrapper from #4140 by creating the authenticator object required for checking and accessing resources in a centralized place. It also introduces a new wrapper withSuperUserAuthRequirements use to gate all poke server side rendering to superuser.

Risk

Deploy Plan

@flvndvd flvndvd marked this pull request as ready for review March 8, 2024 14:34
@@ -83,39 +83,74 @@ export async function getUserFromSession(
};
}

export type AuthLevel = "none" | "user" | "superuser";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe find another name that does not involve "Auth" as this is otherwise easy to confuse with Authenticator Roles? If no good other name, let's add a comment here to clarify that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Went with UserPrivilege.

@flvndvd flvndvd merged commit 40fd56f into main Mar 8, 2024
5 checks passed
@flvndvd flvndvd deleted the flav/augment-session-wrapper-ssr branch March 8, 2024 15:25
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.

2 participants