Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
fix: secret from env usage
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-tkachenko committed Apr 4, 2020
1 parent a8692b2 commit f207b7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/KeycloakUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ const logout = async (accessToken: string, refreshToken: string): Promise<void>
}

const request = prepareRequest(clientConfiguration);
const secret = clientConfiguration.secret || process.env[clientConfiguration.secretEnv];
await request('/protocol/openid-connect/logout', {
method: 'POST',
data: stringify({
refresh_token: refreshToken,
client_id: clientId,
client_secret: clientConfiguration.secret,
client_secret: secret,
}),
headers: {
Authorization: `Bearer ${accessToken}`,
Expand Down Expand Up @@ -159,12 +160,13 @@ const handleCallbackRequest = async (url: string): Promise<ITokenResponse> => {
}

const request = prepareRequest(clientConfiguration);
const secret = clientConfiguration.secret || process.env[clientConfiguration.secretEnv];
const result = await request('/protocol/openid-connect/token', {
method: 'POST',
data: stringify({
code: query.code,
client_id: clientId,
client_secret: clientConfiguration.secret,
client_secret: secret,
grant_type: 'authorization_code',
redirect_uri: redirectUri,
}),
Expand Down

0 comments on commit f207b7d

Please sign in to comment.