mirror of
https://github.com/plankanban/planka.git
synced 2026-02-05 00:39:58 +03:00
[PR #947] [MERGED] fix: Lazy initialize OIDC client #1149
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/plankanban/planka/pull/947
Author: @darktohka
Created: 11/18/2024
Status: ✅ Merged
Merged: 11/19/2024
Merged by: @meltyshev
Base:
master← Head:bugfix/oidc-lazy-loading📝 Commits (2)
88ffa08fix: Lazy initialize OIDC clientf99fcacchore: Fix linting📊 Changes
4 files changed (+55 additions, -20 deletions)
View changed files
📝
server/api/controllers/access-tokens/exchange-using-oidc.js(+7 -0)📝
server/api/controllers/show-config.js(+20 -2)📝
server/api/helpers/users/get-or-create-one-using-oidc.js(+8 -1)📝
server/api/hooks/oidc/index.js(+20 -17)📄 Description
Sometimes, Planka might boot before the OIDC server is ready to respond. In this case the bootup will freeze with an error:
In this state the server is not "running", but it also does not exit, leading to a server hang.
Instead, create the client on first OIDC request (lazy loading). If the OIDC client communication fails, the server will still be running but OIDC related requests (login, configuration) will fail with a 500 Internal Server Error and a log explaining the OIDC error:
This ensures that users who are already logged in can continue to use Planka, and the client will be created automatically when the OIDC client starts back up again and a request to use OIDC is sent.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.