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

Fix authProvider.getPermissions() should not throw error when not logged in #79

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

fzaninotto
Copy link
Member

Problem

The current setup disallows unauthenticated custom routes: the user is redirected to login.

Solution

If no user is logged in, getPermissions should return undefined instead of redirecting to login.

…ogged in

## Problem

The current setup disallows unauthenticated custom routes: the user is redirected to login.

## Solution

If no user is logged in, `getPermissions` should return `undefined` instead of redirecting to login.
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

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

We should also return before even trying to get the user if there is no getPermissions function. Same for getIdentity.

@slax57 slax57 added this to the 3.2.1 milestone Oct 29, 2024
@slax57 slax57 merged commit 04d2ea8 into main Oct 29, 2024
5 checks passed
@slax57 slax57 deleted the fix-auth-provider-getpermissions branch October 29, 2024 09:20
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