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

No role on user results in logging in with role bounds? #66

Closed
epilys opened this issue May 4, 2023 · 0 comments · Fixed by #67
Closed

No role on user results in logging in with role bounds? #66

epilys opened this issue May 4, 2023 · 0 comments · Fixed by #67

Comments

@epilys
Copy link
Contributor

epilys commented May 4, 2023

I noticed this:

fn contains(&self, role: Option<Role>) -> bool {
if let Some(role) = role {
RangeBounds::contains(self, &role)
} else {
role.is_none()
}
}

This returns true if a user's role is None which means this check will authorize the user:

Some(user) if self.role_bounds.contains(user.get_role()) => {

epilys added a commit to epilys/axum-login that referenced this issue May 4, 2023
Because we can't know if RoleBounds is a full range or not, we cannot
know if a None role means we must authenticate the user. So make
RoleBounds optional.

Closes maxcountryman#66
epilys added a commit to epilys/axum-login that referenced this issue May 5, 2023
Because we can't know if RoleBounds is a full range or not, we cannot
know if a None role means we must authenticate the user. So make
RoleBounds optional.

Closes maxcountryman#66
maxcountryman pushed a commit that referenced this issue May 10, 2023
Because we can't know if RoleBounds is a full range or not, we cannot
know if a None role means we must authenticate the user. So make
RoleBounds optional.

Closes #66
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 a pull request may close this issue.

1 participant