Skip to content

Commit

Permalink
Fix Frontend Build and Keycloak Reliance (#180)
Browse files Browse the repository at this point in the history
* fix(frontend): Try to fix SSR

* fix(frontend): Load frontend even if keycloak is down

* chore: Install SWC to avoid warnings
  • Loading branch information
Clashsoft authored Jul 24, 2024
1 parent ba97631 commit c23f8e7
Show file tree
Hide file tree
Showing 3 changed files with 440 additions and 145 deletions.
15 changes: 10 additions & 5 deletions apps/frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ import {LegalModule} from './legal/legal.module';
import {environment} from '../environments/environment';

function initializeKeycloak(keycloak: KeycloakService) {
return () =>
keycloak.init({
return async () => {
if (!globalThis.window) {
return true;
}
return keycloak.init({
config: environment.keycloak,
initOptions: {
onLoad: 'check-sso',
silentCheckSsoRedirectUri: window.location.origin + '/assets/silent-check-sso.html'
}
});
messageReceiveTimeout: 1000,
silentCheckSsoRedirectUri: window.location.origin + '/assets/silent-check-sso.html',
},
}).catch(console.error);
};
}

@NgModule({
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
"@nestjs/swagger": "^7.3.1",
"@nestjs/websockets": "^10.3.10",
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@swc-node/register": "^1.10.9",
"@swc/core": "^1.7.0",
"angular-calendar": "^0.31.1",
"angularx-flatpickr": "^7.3.0",
"axios": "^1.7.2",
Expand Down
Loading

0 comments on commit c23f8e7

Please sign in to comment.