Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycloack token refreshing added + logout on token expiry #1638

Conversation

dudiiiiiiii
Copy link
Contributor

No description provided.

@grzanka
Copy link
Contributor

grzanka commented Jun 12, 2024

ubuntu@yap-dev:~/ui$ time docker compose up --build --detach && ./scripts/update_certs.sh
WARN[0000] /home/ubuntu/ui/docker-compose.yml: `version` is obsolete
[+] Building 213.2s (22/30)                                                                              docker:default
 => [yaptide_ui internal] load build definition from Dockerfile                                                    0.0s
 => => transferring dockerfile: 3.10kB                                                                             0.0s
 => [yaptide_ui internal] load metadata for docker.io/library/nginx:alpine                                         1.0s
 => [yaptide_ui internal] load metadata for docker.io/library/python:3.11                                          1.0s
 => [yaptide_ui internal] load metadata for docker.io/library/node:20                                              1.1s
 => [yaptide_ui internal] load metadata for docker.io/library/alpine:latest                                        1.0s
 => [yaptide_ui internal] load .dockerignore                                                                       0.0s
 => => transferring context: 66B                                                                                   0.0s
 => [yaptide_ui internal] load build context                                                                       0.3s
 => => transferring context: 233.03kB                                                                              0.2s
 => [yaptide_ui cert-gen 1/4] FROM docker.io/library/alpine:latest@sha256:77726ef6b57ddf65bb551896826ec38bc3e53f7  0.0s
 => [yaptide_ui wheel-builder 1/3] FROM docker.io/library/python:3.11@sha256:091e0f5da680e5c972c59cb7eca172141bb6  0.0s
 => [yaptide_ui build  1/11] FROM docker.io/library/node:20@sha256:ab71b9da5ba19445dc5bb76bf99c218941db2c4d70ff4d  0.0s
 => [yaptide_ui stage-3 1/5] FROM docker.io/library/nginx:alpine@sha256:69f8c2c72671490607f52122be2af27d4fc09657f  0.0s
 => CACHED [yaptide_ui build  2/11] WORKDIR /usr/src/app                                                           0.0s
 => CACHED [yaptide_ui build  3/11] COPY package.json package-lock.json ./                                         0.0s
 => CACHED [yaptide_ui build  4/11] RUN npm ci                                                                     0.0s
 => CACHED [yaptide_ui build  5/11] COPY . .                                                                       0.0s
 => CACHED [yaptide_ui build  6/11] RUN git config --global --add safe.directory /usr/src/app                      0.0s
 => CACHED [yaptide_ui build  7/11] RUN npm run identify                                                           0.0s
 => CACHED [yaptide_ui wheel-builder 2/3] COPY src/libs/converter/ .                                               0.0s
 => CACHED [yaptide_ui wheel-builder 3/3] RUN pip install --no-cache-dir pip install "poetry ~= 1.8.2"     && poe  0.0s
 => CACHED [yaptide_ui build  8/11] COPY --from=wheel-builder dist/*.whl public/libs/converter/dist/               0.0s
 => CACHED [yaptide_ui build  9/11] RUN echo "Deploying for prod"                                                  0.0s
 => ERROR [yaptide_ui build 10/11] RUN npx cross-env REACT_APP_DEPLOYMENT=prod npm run build                     211.7s
------
 > [yaptide_ui build 10/11] RUN npx cross-env REACT_APP_DEPLOYMENT=prod npm run build:
1.397
1.397 > threejs-editor-react@0.1.0 prebuild
1.397 > npm run setup
1.397
1.668
1.668 > threejs-editor-react@0.1.0 setup
1.668 > npm run identify && npm run build-python skip
1.668
1.938
1.938 > threejs-editor-react@0.1.0 identify
1.938 > node ./src/util/identify/identify.js > ./src/util/identify/deployInfo.json
1.938
2.353
2.353 > threejs-editor-react@0.1.0 build-python
2.353 > node buildPython.js skip
2.353
2.457 Checking for python3
2.466
2.466 Using: python3
2.484 yaptide_converter-1.0.0-py3-none-any.whl is already installed
2.485 yaptide_converter.json saved
2.517
2.517 > threejs-editor-react@0.1.0 build
2.517 > react-app-rewired build
2.517
5.935 Creating an optimized production build...
211.1 Failed to compile.
211.1
211.1 TS18048: 'keycloak' is possibly 'undefined'.
211.1     296 |                 if (!userLoggedWithKeystone) return Promise.resolve();
211.1     297 |
211.1   > 298 |                 return keycloak
211.1         |                        ^^^^^^^^
211.1     299 |                         .updateToken(300) // 5 minutes in seconds minimum remaining lifetime for token before refresh is allowed
211.1     300 |                         .then(refreshed => {
211.1     301 |                                 if (refreshed)
211.1
211.1
------
failed to solve: process "/bin/sh -c npx cross-env REACT_APP_DEPLOYMENT=${DEPLOYMENT} npm run build" did not complete successfully: exit code: 1

real    3m33.605s
user    0m1.624s
sys     0m1.312s

Copy link

On-demand deploy: failed ❌
https://github.com/yaptide/ui/actions/runs/9487609050

@dudiiiiiiii dudiiiiiiii marked this pull request as ready for review June 18, 2024 14:08
@dudiiiiiiii dudiiiiiiii requested a review from grzanka June 18, 2024 14:09
@grzanka
Copy link
Contributor

grzanka commented Jun 26, 2024

Token seems valid 30 min:

image

After 30 min I click on "Simulation" tab and got "No simulations found". On list of queries to backend I get:

image

Moreover I am still logged in, despite expired token.

@grzanka
Copy link
Contributor

grzanka commented Sep 19, 2024

@dudiiiiiiii please rebase and make some tests on yap-dev

@dudiiiiiiii dudiiiiiiii force-pushed the 1594-user-still-logged-in-when-browser-reopened-after-long-time-not-used branch from e55fd3c to b540c82 Compare September 25, 2024 16:40
@grzanka
Copy link
Contributor

grzanka commented Oct 14, 2024

@dudiiiiiiii can you synchronise this branch with recent changes on master ?

Converter is there at 3189a07
https://github.com/yaptide/ui/tree/master/src/libs

@dudiiiiiiii
Copy link
Contributor Author

dudiiiiiiii commented Oct 15, 2024

@grzanka

I rebased to newest master un yaptide/ui.
From what i can see converter at - 3189a07 is the newest version

@grzanka
Copy link
Contributor

grzanka commented Oct 15, 2024

@grzanka

I rebased to newest master un yaptide/ui. From what i can see converter at - 3189a07 is the newest version

Check here:
https://github.com/yaptide/ui/tree/1594-user-still-logged-in-when-browser-reopened-after-long-time-not-used
Screenshot 2024-10-15 at 07 57 04

It still says "16 commits behind master"

@grzanka
Copy link
Contributor

grzanka commented Oct 15, 2024

To avoid such lengthy commit history, could you squash merge your changes into single commit and put that on top of the newest master ?

@dudiiiiiiii dudiiiiiiii force-pushed the 1594-user-still-logged-in-when-browser-reopened-after-long-time-not-used branch from 020869c to 2413a68 Compare October 15, 2024 21:06
@dudiiiiiiii
Copy link
Contributor Author

To avoid such lengthy commit history, could you squash merge your changes into single commit and put that on top of the newest master ?

Current rebase should be good (previously i did something wrong) and commit history is fixed

@grzanka
Copy link
Contributor

grzanka commented Oct 17, 2024

I am doing some tests on yap-dev now, once I'm done I will give an approve

@grzanka grzanka added this pull request to the merge queue Oct 17, 2024
Merged via the queue into master with commit 79cb439 Oct 17, 2024
10 checks passed
@grzanka grzanka deleted the 1594-user-still-logged-in-when-browser-reopened-after-long-time-not-used branch October 17, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

user still logged in when browser reopened after long time not used
2 participants