Skip to content

Commit

Permalink
Improve logging in Layman Test Client related to Passport.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jirik authored and index-git committed Dec 6, 2023
1 parent 4d99e52 commit dae668e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
- [#960](https://github.com/LayerManager/layman/issues/960) Handle WMS requests with HTTP error more efficiently in timgen.
- [#962](https://github.com/LayerManager/layman/issues/962) Make values of `layman_metadata.publication_status` and `status` key(s) more consistent in responses of PATCH Workspace [Layer](doc/rest.md#patch-workspace-layer)/[Map](doc/rest.md#patch-workspace-map) and GET Workspace [Layer](doc/rest.md#get-workspace-layer)/[Map](doc/rest.md#get-workspace-map).

## v1.22.3
2023-12-06
### Changes
- Improve logging in Layman Test Client related to Passport.js.

## v1.22.2
2023-11-10
### Upgrade requirements
Expand Down
6 changes: 5 additions & 1 deletion client/docker/Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:18-alpine
RUN mkdir /code
WORKDIR /code

RUN apk update && apk add wget
RUN apk update && apk add wget patch

ARG LAYMAN_CLIENT_VERSION
# https://stackoverflow.com/a/42144033
Expand All @@ -15,6 +15,10 @@ RUN wget "https://github.com/LayerManager/layman-test-client/archive/$LAYMAN_CLI

RUN npm ci

COPY docker/passport-oauth2-patch.diff /code/
RUN patch node_modules/passport-oauth2/lib/strategy.js < passport-oauth2-patch.diff
RUN rm passport-oauth2-patch.diff

ARG LTC_BASEPATH
RUN test -n "LTC_BASEPATH"
ENV LTC_BASEPATH=$LTC_BASEPATH
Expand Down
12 changes: 12 additions & 0 deletions client/docker/passport-oauth2-patch.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@@ -174,7 +174,10 @@

self._oauth2.getOAuthAccessToken(code, params,
function(err, accessToken, refreshToken, params) {
- if (err) { return self.error(self._createOAuthError('Failed to obtain access token', err)); }
+ if (err) {
+ console.warn("Failed to obtain access token: ", err);
+ return self.error(self._createOAuthError('Failed to obtain access token', err));
+ }
if (!accessToken) { return self.error(new Error('Failed to obtain access token')); }

self._loadUserProfile(accessToken, function(err, profile) {

0 comments on commit dae668e

Please sign in to comment.