change to firebase auth

This commit is contained in:
2025-02-18 18:05:51 -06:00
parent b9a9b983e9
commit a2e6243e93
34 changed files with 465 additions and 63 deletions

View File

@@ -25,6 +25,7 @@ import { SharedModule } from '../../../shared/shared/shared.module';
import { createMailInfo, map2User } from '../../../utils/utils';
// Import für Leaflet
// Benannte Importe für Leaflet
import { AuthService } from '../../../services/auth.service';
import { BaseDetailsComponent } from '../base-details.component';
@Component({
selector: 'app-details-business-listing',
@@ -80,6 +81,7 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
private auditService: AuditService,
public emailService: EMailService,
private geoService: GeoService,
private authService: AuthService,
) {
super();
this.router.events.subscribe(event => {
@@ -92,7 +94,8 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
}
async ngOnInit() {
const token = await this.keycloakService.getToken();
// const token = await this.keycloakService.getToken();
const token = await this.authService.getToken();
this.keycloakUser = map2User(token);
if (this.keycloakUser) {
this.user = await this.userService.getByMail(this.keycloakUser.email);

View File

@@ -17,6 +17,7 @@ import { ValidatedNgSelectComponent } from '../../../components/validated-ng-sel
import { ValidatedTextareaComponent } from '../../../components/validated-textarea/validated-textarea.component';
import { ValidationMessagesService } from '../../../components/validation-messages.service';
import { AuditService } from '../../../services/audit.service';
import { AuthService } from '../../../services/auth.service';
import { HistoryService } from '../../../services/history.service';
import { ImageService } from '../../../services/image.service';
import { ListingsService } from '../../../services/listings.service';
@@ -84,13 +85,15 @@ export class DetailsCommercialPropertyListingComponent extends BaseDetailsCompon
private messageService: MessageService,
private auditService: AuditService,
private emailService: EMailService,
private authService: AuthService,
) {
super();
this.mailinfo = { sender: {}, email: '', url: environment.mailinfoUrl };
}
async ngOnInit() {
const token = await this.keycloakService.getToken();
// const token = await this.keycloakService.getToken();
const token = await this.authService.getToken();
this.keycloakUser = map2User(token);
if (this.keycloakUser) {
this.user = await this.userService.getByMail(this.keycloakUser.email);

View File

@@ -6,6 +6,7 @@ import { Observable } from 'rxjs';
import { BusinessListing, CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model';
import { KeycloakUser, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
import { environment } from '../../../../environments/environment';
import { AuthService } from '../../../services/auth.service';
import { HistoryService } from '../../../services/history.service';
import { ImageService } from '../../../services/image.service';
import { ListingsService } from '../../../services/listings.service';
@@ -46,6 +47,7 @@ export class DetailsUserComponent {
private imageService: ImageService,
public historyService: HistoryService,
public keycloakService: KeycloakService,
private authService: AuthService,
) {}
async ngOnInit() {
@@ -55,7 +57,8 @@ export class DetailsUserComponent {
this.businessListings = results[0];
this.commercialPropListings = results[1] as CommercialPropertyListing[];
//this.user$ = this.userService.getUserObservable();
const token = await this.keycloakService.getToken();
// const token = await this.keycloakService.getToken();
const token = await this.authService.getToken();
this.keycloakUser = map2User(token);
this.companyOverview = this.sanitizer.bypassSecurityTrustHtml(this.user.companyOverview ? this.user.companyOverview : '');
this.offeredServices = this.sanitizer.bypassSecurityTrustHtml(this.user.offeredServices ? this.user.offeredServices : '');