Skip to content

Commit

Permalink
Make AuthConfig optional
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Jun 26, 2024
1 parent a966785 commit 156d7f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion src/environments/environment.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface Environment {
production: boolean;
label: string;
backendUrl: string;
authConfig: AuthConfig;
authConfig?: AuthConfig;
disableBackend: boolean;
customElement: boolean;
}
28 changes: 0 additions & 28 deletions src/environments/environment.standalone.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,9 @@
import {AuthConfig} from "angular-oauth2-oidc";
import {Environment} from "./environment.model";

// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

const authConfig: AuthConfig = {
issuer: "http://localhost:8081/realms/netzgrafikeditor",
// The ClientId you received from the IAM Team
clientId: "netzgrafikeditor",
// For production with Angular i18n the language code needs to be included in the redirectUri.
// In your environment.prod.ts (or similar, but not your environment.ts) replace it with the following line:
// redirectUri: location.origin + location.pathname.substring(0, location.pathname.indexOf('/', 1) + 1)
// Note that these URIs must also be added to allowed redirect URIs in Azure (e.g. https://your-domain/en/, https://your-domain/de/, ...)
redirectUri: location.origin,
responseType: "code",
scope: "openid profile email offline_access",
};

export const environment: Environment = {
production: false,
label: "standalone",
backendUrl: "http://localhost:8080",
authConfig,
disableBackend: true,
customElement: true,
};

/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

0 comments on commit 156d7f1

Please sign in to comment.