remove keycloak
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { KeycloakService } from 'keycloak-angular';
|
||||
import { StripeService } from 'ngx-stripe';
|
||||
import { switchMap } from 'rxjs';
|
||||
import { User } from '../../../../../bizmatch-server/src/models/db.model';
|
||||
@@ -27,7 +26,6 @@ export class PricingComponent {
|
||||
keycloakUser: KeycloakUser;
|
||||
user: User;
|
||||
constructor(
|
||||
public keycloakService: KeycloakService,
|
||||
private http: HttpClient,
|
||||
private stripeService: StripeService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
@@ -38,7 +36,6 @@ export class PricingComponent {
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
// const token = await this.keycloakService.getToken();
|
||||
const token = await this.authService.getToken();
|
||||
this.keycloakUser = map2User(token);
|
||||
if (this.keycloakUser) {
|
||||
@@ -59,19 +56,6 @@ export class PricingComponent {
|
||||
this.checkout({ priceId: atob(base64PriceId), email: this.keycloakUser.email, name: `${this.keycloakUser.firstName} ${this.keycloakUser.lastName}` });
|
||||
}
|
||||
}
|
||||
// if (this.id === 'free' || this.keycloakUser.priceId === 'free') {
|
||||
// this.user.subscriptionPlan = 'free';
|
||||
// await this.userService.saveGuaranteed(this.user);
|
||||
// this.router.navigate([`/account`]);
|
||||
// } else if (this.id || this.keycloakUser.priceId) {
|
||||
// const priceId = this.id ? this.id : this.keycloakUser.priceId;
|
||||
// this.checkout({ priceId: atob(priceId), email: this.keycloakUser.email, name: `${this.keycloakUser.firstName} ${this.keycloakUser.lastName}` });
|
||||
// } else if (!this.id && !this.pricingOverview) {
|
||||
// this.user = await this.userService.getByMail(this.keycloakUser.email);
|
||||
// if (this.user.subscriptionId) {
|
||||
// this.router.navigate([`/account`]);
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
this.pricingOverview = false;
|
||||
}
|
||||
@@ -88,13 +72,13 @@ export class PricingComponent {
|
||||
this.checkout({ priceId: priceId, email: this.keycloakUser.email, name: `${this.keycloakUser.firstName} ${this.keycloakUser.lastName}` });
|
||||
}
|
||||
} else {
|
||||
if (priceId) {
|
||||
this.keycloakService.register({
|
||||
redirectUri: `${window.location.origin}/pricing/${btoa(priceId)}`,
|
||||
});
|
||||
} else {
|
||||
this.keycloakService.register({ redirectUri: `${window.location.origin}/pricing/free` });
|
||||
}
|
||||
// if (priceId) {
|
||||
// this.keycloakService.register({
|
||||
// redirectUri: `${window.location.origin}/pricing/${btoa(priceId)}`,
|
||||
// });
|
||||
// } else {
|
||||
// this.keycloakService.register({ redirectUri: `${window.location.origin}/pricing/free` });
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user