Skip to content

Commit

Permalink
Sync env names with doppler
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikhorluck committed Feb 24, 2024
1 parent b90441e commit 70710c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 4 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ module.exports = withBundleAnalyzer(
return config;
},
env: {
HOSTNAME: process.env.HOSTNAME || "localhost",
PORT: process.env.PORT || "8000",
OW4_ADDRESS: process.env.OW4_ADDRESS || 'https://old.online.ntnu.no',
OW4_SSO_CLIENT_ID: process.env.OW4_SSO_CLIENT_ID || '',
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID || '',
OW4_SSO_CALLBACK: process.env.OW4_SSO_CALLBACK || 'http://localhost:8080/authentication/callback',
OWF_SENTRY_DSN: process.env.OWF_SENTRY_DSN || '',
OWF_GOOGLE_ANALYTICS_KEY: process.env.OWF_GOOGLE_ANALYTICS_KEY || '',
OWF_VAPID_SERVER_KEY: process.env.OWF_VAPID_SERVER_KEY || '',
OWF_AUTH_DOMAIN: process.env.OWF_AUTH_DOMAIN || '',
AUTH0_ISSUER: process.env.AUTH0_ISSUER || '',
STRIPE_PUBLIC_KEY_ARRKOM: process.env.STRIPE_PUBLIC_KEY_ARRKOM || null,
STRIPE_PUBLIC_KEY_FAGKOM: process.env.STRIPE_PUBLIC_KEY_FAGKOM || null,
STRIPE_PUBLIC_KEY_PROKOM: process.env.STRIPE_PUBLIC_KEY_PROKOM || null,
Expand Down
13 changes: 5 additions & 8 deletions src/authentication/api/settings.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { AUTH_DOMAIN, DOMAIN } from 'common/constants/endpoints';
import { HOST } from 'common/constants/endpoints';
import { UserManagerSettings } from 'oidc-client-ts';

const settings: UserManagerSettings = {
authority: AUTH_DOMAIN,
client_id: process.env.OW4_SSO_CLIENT_ID || '',
authority: process.env.AUTH0_ISSUER || '',
client_id: process.env.AUTH0_CLIENT_ID || '',
redirect_uri: process.env.OW4_SSO_CALLBACK || '',
post_logout_redirect_uri: DOMAIN + '/',
scope: 'openid profile onlineweb4 email',
post_logout_redirect_uri: HOST,
scope: 'openid profile email',
automaticSilentRenew: true,
filterProtocolClaims: true,
loadUserInfo: true,
extraQueryParams: {
audience: 'https://online.ntnu.no',
},
revokeTokensOnSignout: true,
revokeTokenTypes: ['refresh_token'],
};
Expand Down
4 changes: 3 additions & 1 deletion src/common/constants/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export const DOMAIN = process.env.OW4_ADDRESS || '';
export const AUTH_DOMAIN = process.env.OWF_AUTH_DOMAIN || '';
export const HOST = process.env.NODE_ENV === "production"

Check failure on line 2 in src/common/constants/endpoints.ts

View workflow job for this annotation

GitHub Actions / ESLint

src/common/constants/endpoints.ts#L2

Replace `·process.env.NODE_ENV·===·"production"` with `⏎··process.env.NODE_ENV·===·'production'` (prettier/prettier)
? `https://${process.env.HOSTNAME}`
: `http://${process.env.HOSTNAME}:${process.env.PORT}`;

export const AUTH = DOMAIN + '/api/v1/sso/openid/';
export const EVENTS = DOMAIN + '/api/v1/events/';
Expand Down

0 comments on commit 70710c0

Please sign in to comment.