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

Don't logout if deviceId is null #6038

Merged
merged 1 commit into from May 24, 2021

Conversation

@crobibero
Copy link
Member

@crobibero crobibero commented May 12, 2021

As reported by @nielsvanvelzen
This fixes an issue that occurs if a client sends an authorization request without a DeviceId set- all tokens are removed. The proper fix would be to set the [Required] attribute but I don't want to potentially break existing clients.

[2021-05-10 19:55:07.083 +02:00] [INF] [21] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for "Demo" has succeeded.
[2021-05-10 19:55:07.084 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user "Demo": 3/0
[2021-05-10 19:55:07.086 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.092 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.097 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.102 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.107 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.111 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.116 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.121 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.126 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.132 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.144 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.155 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.160 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.165 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.169 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.177 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.182 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.186 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.191 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.196 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.201 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.206 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.213 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.218 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.223 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.229 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.234 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.239 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.244 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.249 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.254 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.259 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.264 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.269 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.274 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.279 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Logging out access token "[...]"
[2021-05-10 19:55:07.284 +02:00] [INF] [21] Emby.Server.Implementations.Session.SessionManager: Reissuing access token: "[...]"
@crobibero crobibero requested a review from nielsvanvelzen May 12, 2021
@crobibero crobibero added this to Active PRs in Current Release via automation May 12, 2021
@github-actions
Copy link

@github-actions github-actions bot commented May 12, 2021

Hello @

This pull request has been tagged as a stable backport. It will be cherry-picked into the next stable point release.

Please observe the following:

  • Any dependent PRs that this PR requires must be tagged for stable backporting as well.

  • Any issue(s) this PR fixes or closes should target the current stable release or a previous stable release to which a fix has not yet entered the current stable release.

  • This PR must be test cherry-picked against the current release branch (release-X.Y.z where X and Y are numbers). It must apply cleanly, or a diff of the expected change must be provided.

    To do this, run the following commands from your local copy of the Jellyfin repository:

    1. git checkout master

    2. git merge --no-ff <myPullRequestBranch>

    3. git log -> commit xxxxxxxxx, grab hash

    4. git checkout release-X.Y.z replacing X and Y with the current stable version (e.g. release-10.7.z)

    5. git cherry-pick -sx -m1 <hash>

    Ensure the cherry-pick applies cleanly. If it does not, fix any merge conflicts preserving as much of the original code as possible, and make note of the resulting diff.

    Test your changes with a build to ensure they are successful. If not, adjust the diff accordingly.

    Do not push your merges to either branch. Use git reset --hard HEAD~1 to revert both branches to their original state.

    Reply to this PR with a comment beginning "Cherry-pick test completed." and including the merge-conflict-fixing diff(s) if applicable.


This is an automated comment created by the peaceiris/actions-label-commenter. Responding to the bot or mentioning it won't have any effect.

@crobibero
Copy link
Member Author

@crobibero crobibero commented May 12, 2021

Cherry-pick test completed.

Auto-merging Emby.Server.Implementations/Session/SessionManager.cs
[release-10.7.z afddd5b58] Merge branch 'delete-existing-sessions'
 Date: Wed May 12 13:40:09 2021 -0600
 1 file changed, 17 insertions(+), 14 deletions(-)
@cvium cvium merged commit 1594385 into jellyfin:master May 24, 2021
14 checks passed
14 checks passed
@github-actions
main main
Details
@github-actions
Analyze (csharp) Analyze (csharp)
Details
@github-actions
comment
Details
@github-code-scanning
CodeQL No new or fixed alerts
Details
@azure-pipelines
Jellyfin Server Build #20210512.4 succeeded
Details
@azure-pipelines
Jellyfin Server (Build Debug) Build Debug succeeded
Details
@azure-pipelines
Jellyfin Server (Build Release) Build Release succeeded
Details
@azure-pipelines
Jellyfin Server (Compatibility Check Common) Compatibility Check Common succeeded
Details
@azure-pipelines
Jellyfin Server (Compatibility Check Controller) Compatibility Check Controller succeeded
Details
@azure-pipelines
Jellyfin Server (Compatibility Check Model) Compatibility Check Model succeeded
Details
@azure-pipelines
Jellyfin Server (Compatibility Check Naming) Compatibility Check Naming succeeded
Details
@azure-pipelines
Jellyfin Server (Test Linux) Test Linux succeeded
Details
@azure-pipelines
Jellyfin Server (Test Windows) Test Windows succeeded
Details
@azure-pipelines
Jellyfin Server (Test macOS) Test macOS succeeded
Details
Current Release automation moved this from Active PRs to Completed PRs May 24, 2021
joshuaboniface added a commit that referenced this pull request May 27, 2021
Don't logout if deviceId is null

(cherry picked from commit 1594385)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
@joshuaboniface joshuaboniface moved this from Completed PRs to Jellyfinished in Current Release May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Current Release
  
Jellyfinished
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants