diff --git a/client/docker/Dockerfile.production b/client/docker/Dockerfile.production index 8d0f82a54..3054ba7e9 100644 --- a/client/docker/Dockerfile.production +++ b/client/docker/Dockerfile.production @@ -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 @@ -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 diff --git a/client/docker/passport-oauth2-patch.diff b/client/docker/passport-oauth2-patch.diff new file mode 100644 index 000000000..24cffa4d4 --- /dev/null +++ b/client/docker/passport-oauth2-patch.diff @@ -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) {