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: make user creation more robust #72

Merged
merged 1 commit into from
Aug 20, 2022

Conversation

fredriklindberg
Copy link
Contributor

If a user is created through SSO, then deleted through Jellyfin, but not de-linked, then the same user is prevented from logging in again.

The reason is that the canonical link resolves to a non-existing user and the plugin crashes in Authenticate() when trying to dereference a null object.

The patch reverses the logic of CreateCanonicalLinkAndUserIfNotExist() to first check if the user exists,
then create the canonical link. It also cleans up trailing links when creating the user.

This allows seamless re-creation of users through SSO after they have been deleted from Jellyfin but not properly de-linked.

Reverse logic of CreateCanonicalLinkAndUserIfNotExist() to first check if the user exists,
then create the canonical link. This allows seamless re-creation of users through SSO after
they have been deleted from Jellyfin but not properly de-linked.
@strazto strazto requested review from 9p4 and strazto August 20, 2022 04:54
@strazto
Copy link
Collaborator

strazto commented Aug 20, 2022

Thanks for the PR! I'll try to check it out later today 🌝

Copy link
Collaborator

@strazto strazto left a comment

Choose a reason for hiding this comment

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

LGTM

@strazto
Copy link
Collaborator

strazto commented Aug 20, 2022

I didn't mean to merge main in ugh

@strazto strazto force-pushed the make-user-creation-more-robust branch from 2a4b95c to d06f680 Compare August 20, 2022 11:07
@strazto strazto merged commit fe1fdad into 9p4:main Aug 20, 2022
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.

None yet

2 participants