Browse Source

Merge branch 'main' into feature/improve-activities-import-for-csv-files-of-ibkr

pull/1824/head
Thomas Kaul 2 years ago
committed by GitHub
parent
commit
fd69de29a4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 13
      apps/api/src/app/auth/auth.controller.ts
  3. 6
      apps/client/src/app/services/data.service.ts
  4. 6
      apps/client/src/app/services/internet-identity.service.ts

2
CHANGELOG.md

@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the activities import for `csv` files exported by _Interactive Brokers_
- Improved the content of the Frequently Asked Questions (FAQ) page
- Improved the content of the pricing page
- Changed the `auth` endpoint of the login with _Security Token_ from `GET` to `POST`
- Changed the `auth` endpoint of the _Internet Identity_ login provider from `GET` to `POST`
## 1.250.0 - 2023-04-02

13
apps/api/src/app/auth/auth.controller.ts

@ -7,7 +7,6 @@ import {
Controller,
Get,
HttpException,
Param,
Post,
Req,
Res,
@ -33,13 +32,13 @@ export class AuthController {
private readonly webAuthService: WebAuthService
) {}
@Get('anonymous/:accessToken')
@Post('anonymous')
public async accessTokenLogin(
@Param('accessToken') accessToken: string
@Body() body: { accessToken: string }
): Promise<OAuthResponse> {
try {
const authToken = await this.authService.validateAnonymousLogin(
accessToken
body.accessToken
);
return { authToken };
} catch {
@ -81,13 +80,13 @@ export class AuthController {
}
}
@Get('internet-identity/:principalId')
@Post('internet-identity')
public async internetIdentityLogin(
@Param('principalId') principalId: string
@Body() body: { principalId: string }
): Promise<OAuthResponse> {
try {
const authToken = await this.authService.validateInternetIdentityLogin(
principalId
body.principalId
);
return { authToken };
} catch {

6
apps/client/src/app/services/data.service.ts

@ -388,9 +388,9 @@ export class DataService {
}
public loginAnonymous(accessToken: string) {
return this.http.get<OAuthResponse>(
`/api/v1/auth/anonymous/${accessToken}`
);
return this.http.post<OAuthResponse>(`/api/v1/auth/anonymous`, {
accessToken
});
}
public postAccess(aAccess: CreateAccessDto) {

6
apps/client/src/app/services/internet-identity.service.ts

@ -30,9 +30,9 @@ export class InternetIdentityService implements OnDestroy {
const principalId = authClient.getIdentity().getPrincipal();
this.http
.get<OAuthResponse>(
`/api/v1/auth/internet-identity/${principalId.toText()}`
)
.post<OAuthResponse>(`/api/v1/auth/internet-identity`, {
principalId: principalId.toText()
})
.pipe(
catchError(() => {
reject();

Loading…
Cancel
Save