Thomas Kaul
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
17 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/app/subscription/subscription.service.ts
-
apps/client/src/app/core/auth.guard.ts
-
apps/client/src/app/pages/auth/auth-page.component.ts
-
apps/client/src/app/services/token-storage.service.ts
-
package.json
|
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. |
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
|
|
|
|
|
|
## 1.179.0 - 13.08.2022 |
|
|
## 1.179.1 - 13.08.2022 |
|
|
|
|
|
|
|
|
### Added |
|
|
### Added |
|
|
|
|
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
|
|
import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config'; |
|
|
import { SubscriptionType } from '@ghostfolio/common/types/subscription.type'; |
|
|
import { SubscriptionType } from '@ghostfolio/common/types/subscription.type'; |
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
import { Subscription } from '@prisma/client'; |
|
|
import { Subscription } from '@prisma/client'; |
|
@ -33,7 +34,9 @@ export class SubscriptionService { |
|
|
userId: string; |
|
|
userId: string; |
|
|
}) { |
|
|
}) { |
|
|
const checkoutSessionCreateParams: Stripe.Checkout.SessionCreateParams = { |
|
|
const checkoutSessionCreateParams: Stripe.Checkout.SessionCreateParams = { |
|
|
cancel_url: `${this.configurationService.get('ROOT_URL')}/account`, |
|
|
cancel_url: `${this.configurationService.get( |
|
|
|
|
|
'ROOT_URL' |
|
|
|
|
|
)}/${DEFAULT_LANGUAGE_CODE}/account`,
|
|
|
client_reference_id: userId, |
|
|
client_reference_id: userId, |
|
|
line_items: [ |
|
|
line_items: [ |
|
|
{ |
|
|
{ |
|
|
|
@ -48,6 +48,8 @@ export class AuthGuard implements CanActivate { |
|
|
.get() |
|
|
.get() |
|
|
.pipe( |
|
|
.pipe( |
|
|
catchError(() => { |
|
|
catchError(() => { |
|
|
|
|
|
console.log(`TODO: canActivate error (${state.url})`); |
|
|
|
|
|
|
|
|
if (utmSource === 'ios') { |
|
|
if (utmSource === 'ios') { |
|
|
this.router.navigate(['/demo']); |
|
|
this.router.navigate(['/demo']); |
|
|
resolve(false); |
|
|
resolve(false); |
|
@ -72,6 +74,8 @@ export class AuthGuard implements CanActivate { |
|
|
}) |
|
|
}) |
|
|
) |
|
|
) |
|
|
.subscribe((user) => { |
|
|
.subscribe((user) => { |
|
|
|
|
|
console.log(`TODO: canActivate`, user); |
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|
state.url.startsWith('/home') && |
|
|
state.url.startsWith('/home') && |
|
|
user.settings.viewMode === ViewMode.ZEN |
|
|
user.settings.viewMode === ViewMode.ZEN |
|
|
|
@ -24,10 +24,15 @@ export class AuthPageComponent implements OnDestroy, OnInit { |
|
|
) {} |
|
|
) {} |
|
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
public ngOnInit() { |
|
|
|
|
|
console.log('TODO: Init AuthPageComponent'); |
|
|
|
|
|
|
|
|
this.route.params |
|
|
this.route.params |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.subscribe((params) => { |
|
|
.subscribe((params) => { |
|
|
const jwt = params['jwt']; |
|
|
const jwt = params['jwt']; |
|
|
|
|
|
|
|
|
|
|
|
console.log(`TODO: ${jwt}`); |
|
|
|
|
|
|
|
|
this.tokenStorageService.saveToken( |
|
|
this.tokenStorageService.saveToken( |
|
|
jwt, |
|
|
jwt, |
|
|
this.settingsStorageService.getSetting(STAY_SIGNED_IN) === 'true' |
|
|
this.settingsStorageService.getSetting(STAY_SIGNED_IN) === 'true' |
|
|
|
@ -22,6 +22,8 @@ export class TokenStorageService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public saveToken(token: string, staySignedIn = false): void { |
|
|
public saveToken(token: string, staySignedIn = false): void { |
|
|
|
|
|
console.log('TODO: saveToken', token); |
|
|
|
|
|
|
|
|
if (staySignedIn) { |
|
|
if (staySignedIn) { |
|
|
window.localStorage.setItem(TOKEN_KEY, token); |
|
|
window.localStorage.setItem(TOKEN_KEY, token); |
|
|
} |
|
|
} |
|
|
|
@ -1,6 +1,6 @@ |
|
|
{ |
|
|
{ |
|
|
"name": "ghostfolio", |
|
|
"name": "ghostfolio", |
|
|
"version": "1.179.0", |
|
|
"version": "1.179.1", |
|
|
"homepage": "https://ghostfol.io", |
|
|
"homepage": "https://ghostfol.io", |
|
|
"license": "AGPL-3.0", |
|
|
"license": "AGPL-3.0", |
|
|
"scripts": { |
|
|
"scripts": { |
|
|