Skip to content

Commit

Permalink
Improve logging in LTC
Browse files Browse the repository at this point in the history
  • Loading branch information
jirik committed Dec 4, 2023
1 parent b8fcfb1 commit ec415e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
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 ec415e4

Please sign in to comment.