Skip to content

Commit

Permalink
Fixed SSG issues, also made environment file static. Probably more se…
Browse files Browse the repository at this point in the history
…cure too.
  • Loading branch information
sigfriedseldeslachts committed Oct 23, 2024
1 parent 50ec1aa commit 36575a3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
10 changes: 8 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"scripts": [],
"browser": "src/main.ts",
"server": "src/main.server.ts",
"prerender": true,
"prerender": {
"discoverRoutes": false,
"routesFile": "prerender-routes.txt"
},
"ssr": false
},
"configurations": {
Expand All @@ -61,7 +64,10 @@
},
"staging": {
"extractLicenses": true,
"prerender": true,
"prerender": {
"discoverRoutes": false,
"routesFile": "prerender-routes.txt"
},
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
Expand Down
9 changes: 8 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ export function storageFactory(): OAuthStorage {
multi: true,
},
{provide: HTTP_INTERCEPTORS, useClass: JWTInterceptor, multi: true},
{provide: OAuthStorage, useFactory: storageFactory},
{
provide: OAuthStorage, useFactory: () => {
if (typeof localStorage !== 'undefined') {
return localStorage;
}
return null;
}
},
provideClientHydration(),
provideHttpClient(withFetch()),
provideHttpClient(withInterceptorsFromDi()),
Expand Down
4 changes: 2 additions & 2 deletions src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { versions } from "@ingenium/environments/versions";

const OAuthConfig: AuthConfig = {
issuer: 'https://sso.ingeniumua.be/realms/IngeniumTESTING',
redirectUri: window.location.origin + '/auth/callback',
postLogoutRedirectUri: window.location.origin + '/auth/logout',
redirectUri: 'https://dev.ingeniumua.be/auth/callback',
postLogoutRedirectUri: 'https://dev.ingeniumua.be/auth/logout',
clientId: 'ingeniumwebsite',
responseType: 'code',
scope: 'openid profile email',
Expand Down
4 changes: 2 additions & 2 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { versions } from "@ingenium/environments/versions";

const OAuthConfig: AuthConfig = {
issuer: 'https://sso.ingeniumua.be/realms/ingeniumua',
redirectUri: window.location.origin + '/auth/callback',
postLogoutRedirectUri: window.location.origin + '/auth/logout',
redirectUri: 'https://ingeniumua.be/auth/callback',
postLogoutRedirectUri: 'https://ingeniumua.be/auth/logout',
clientId: 'ingeniumwebsite',
responseType: 'code',
scope: 'openid profile email',
Expand Down

0 comments on commit 36575a3

Please sign in to comment.