From e33f49f7ec8c3682280b73d76708286f89c77aa0 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Tue, 29 Aug 2023 02:17:49 -0300 Subject: [PATCH 1/2] Implements Automatic Profile Image Reload Automatically reloads image after Add Profile Image operation --- src/app/shared/auth/auth.service.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/shared/auth/auth.service.ts b/src/app/shared/auth/auth.service.ts index de9a73b..9d3bf68 100644 --- a/src/app/shared/auth/auth.service.ts +++ b/src/app/shared/auth/auth.service.ts @@ -46,6 +46,10 @@ export class AuthService { } + refresh(): void { + this.validateUser(this.refreshAccessToken()); + } + autoLogin(): void { this.validateUser(this.validateSession()); } @@ -68,7 +72,11 @@ export class AuthService { (response: Observable) => { response.subscribe({ next: (response: any) => { - this.processProfilePicture().subscribe(); + this.processProfilePicture().subscribe( + () => { + this.refresh(); + } + ); } }); } @@ -146,11 +154,11 @@ export class AuthService { } private refreshAccessToken() { - return firstValueFrom(this.http.post( + return this.http.post( this.BACKEND_PATH + "/user/login/refresh", this.userAuthenticated.refreshToken, { withCredentials: true } - )); + ); } private validateSession(): Observable { From 535aa8f5f2500d5296bc418f8c0a8488f383b525 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Tue, 29 Aug 2023 02:27:58 -0300 Subject: [PATCH 2/2] Removes Unnecessary Parts from Github Actions --- .github/workflows/docker-publish.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 48a4ff2..97fbcc1 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,7 +6,7 @@ on: - 'main' jobs: - + build: runs-on: ubuntu-latest @@ -19,35 +19,26 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - env: - PORT: '5000' - BACKEND_PATH: 'unsecure' uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'npm' - - run: npm ci + - run: npm install - run: npm run build --if-present docker: - - + + needs: [build] runs-on: ubuntu-latest steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - + - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - + - name: Build and push uses: docker/build-push-action@v2 with: