mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
fix: decode oidc client_secret before token exchange
This commit is contained in:
1 parent
ec87f8a4d1
commit
51d469008c
1 file changed
+12
@@ -949,6 +949,18 @@ router.get("/oidc/callback", async (req, res) => {
|
||||
config = JSON.parse(
|
||||
(configRow as Record<string, unknown>).value as string,
|
||||
);
|
||||
|
||||
if (config.client_secret?.startsWith("encrypted:")) {
|
||||
config.client_secret = Buffer.from(
|
||||
config.client_secret.substring(10),
|
||||
"base64",
|
||||
).toString("utf8");
|
||||
} else if (config.client_secret?.startsWith("encoded:")) {
|
||||
config.client_secret = Buffer.from(
|
||||
config.client_secret.substring(8),
|
||||
"base64",
|
||||
).toString("utf8");
|
||||
}
|
||||
}
|
||||
|
||||
const tokenResponse = await fetch(config.token_url, {
|
||||
|
||||
Reference in new issue
Block a user