Merge pull request #19 from HideyoshiNakazone/devel
- Implements automatic profile image reload - Implements Better Github Actions
This commit is contained in:
11
.github/workflows/docker-publish.yml
vendored
11
.github/workflows/docker-publish.yml
vendored
@@ -19,14 +19,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
env:
|
|
||||||
PORT: '5000'
|
|
||||||
BACKEND_PATH: 'unsecure'
|
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: npm ci
|
- run: npm install
|
||||||
- run: npm run build --if-present
|
- run: npm run build --if-present
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
@@ -36,12 +33,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ export class AuthService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refresh(): void {
|
||||||
|
this.validateUser(this.refreshAccessToken());
|
||||||
|
}
|
||||||
|
|
||||||
autoLogin(): void {
|
autoLogin(): void {
|
||||||
this.validateUser(this.validateSession());
|
this.validateUser(this.validateSession());
|
||||||
}
|
}
|
||||||
@@ -68,7 +72,11 @@ export class AuthService {
|
|||||||
(response: Observable<any>) => {
|
(response: Observable<any>) => {
|
||||||
response.subscribe({
|
response.subscribe({
|
||||||
next: (response: any) => {
|
next: (response: any) => {
|
||||||
this.processProfilePicture().subscribe();
|
this.processProfilePicture().subscribe(
|
||||||
|
() => {
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -146,11 +154,11 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private refreshAccessToken() {
|
private refreshAccessToken() {
|
||||||
return firstValueFrom(this.http.post(
|
return this.http.post<User>(
|
||||||
this.BACKEND_PATH + "/user/login/refresh",
|
this.BACKEND_PATH + "/user/login/refresh",
|
||||||
this.userAuthenticated.refreshToken,
|
this.userAuthenticated.refreshToken,
|
||||||
{ withCredentials: true }
|
{ withCredentials: true }
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private validateSession(): Observable<User> {
|
private validateSession(): Observable<User> {
|
||||||
|
|||||||
Reference in New Issue
Block a user