Browse Source

Feature/remove environment variable web auth rp (#3115)

* Remove environment variable WEB_AUTH_RP_ID

* Update changelog
pull/3119/head
Thomas Kaul 11 months ago
committed by GitHub
parent
commit
1f2f9f22f2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      apps/api/src/app/auth/web-auth.service.ts
  3. 7
      apps/api/src/services/configuration/configuration.service.ts
  4. 1
      apps/api/src/services/interfaces/environment.interface.ts

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Integrated dividend into the transaction point concept in the portfolio service
- Removed the environment variable `WEB_AUTH_RP_ID`
## 2.61.1 - 2024-03-06

2
apps/api/src/app/auth/web-auth.service.ts

@ -41,7 +41,7 @@ export class WebAuthService {
) {}
get rpID() {
return this.configurationService.get('WEB_AUTH_RP_ID');
return new URL(this.configurationService.get('ROOT_URL')).hostname;
}
get expectedOrigin() {

7
apps/api/src/services/configuration/configuration.service.ts

@ -3,7 +3,7 @@ import { DEFAULT_ROOT_URL } from '@ghostfolio/common/config';
import { Injectable } from '@nestjs/common';
import { DataSource } from '@prisma/client';
import { bool, cleanEnv, host, json, num, port, str } from 'envalid';
import { bool, cleanEnv, host, json, num, port, str, url } from 'envalid';
@Injectable()
export class ConfigurationService {
@ -48,14 +48,13 @@ export class ConfigurationService {
REDIS_PASSWORD: str({ default: '' }),
REDIS_PORT: port({ default: 6379 }),
REQUEST_TIMEOUT: num({ default: 2000 }),
ROOT_URL: str({ default: DEFAULT_ROOT_URL }),
ROOT_URL: url({ default: DEFAULT_ROOT_URL }),
STRIPE_PUBLIC_KEY: str({ default: '' }),
STRIPE_SECRET_KEY: str({ default: '' }),
TWITTER_ACCESS_TOKEN: str({ default: 'dummyAccessToken' }),
TWITTER_ACCESS_TOKEN_SECRET: str({ default: 'dummyAccessTokenSecret' }),
TWITTER_API_KEY: str({ default: 'dummyApiKey' }),
TWITTER_API_SECRET: str({ default: 'dummyApiSecret' }),
WEB_AUTH_RP_ID: host({ default: 'localhost' })
TWITTER_API_SECRET: str({ default: 'dummyApiSecret' })
});
}

1
apps/api/src/services/interfaces/environment.interface.ts

@ -42,5 +42,4 @@ export interface Environment extends CleanedEnvAccessors {
TWITTER_ACCESS_TOKEN_SECRET: string;
TWITTER_API_KEY: string;
TWITTER_API_SECRET: string;
WEB_AUTH_RP_ID: string;
}

Loading…
Cancel
Save