Issues #47,#42, #35 resolved, request logging erweitert
This commit is contained in:
@@ -20,6 +20,7 @@ export class AuthGuard extends KeycloakAuthGuard {
|
||||
}
|
||||
// Force the user to log in if currently unauthenticated.
|
||||
const authenticated = this.keycloak.isLoggedIn();
|
||||
//this.keycloak.isTokenExpired()
|
||||
if (!this.authenticated && !authenticated) {
|
||||
await this.keycloak.login({
|
||||
redirectUri: window.location.origin + state.url,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { MailService } from '../../../services/mail.service';
|
||||
import { SelectOptionsService } from '../../../services/select-options.service';
|
||||
import { UserService } from '../../../services/user.service';
|
||||
import { SharedModule } from '../../../shared/shared/shared.module';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler } from '../../../utils/utils';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler, map2User } from '../../../utils/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-details-business-listing',
|
||||
@@ -49,7 +49,8 @@ export class DetailsBusinessListingComponent {
|
||||
criteria: ListingCriteria;
|
||||
mailinfo: MailInfo;
|
||||
environment = environment;
|
||||
user: KeycloakUser;
|
||||
keycloakUser: KeycloakUser;
|
||||
user: User;
|
||||
listingUser: User;
|
||||
description: SafeHtml;
|
||||
private history: string[] = [];
|
||||
@@ -73,11 +74,16 @@ export class DetailsBusinessListingComponent {
|
||||
}
|
||||
});
|
||||
this.mailinfo = { sender: {}, userId: '', email: '', url: environment.mailinfoUrl };
|
||||
this.user;
|
||||
this.criteria = onChange(getCriteriaStateObject(), getSessionStorageHandler);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
const token = await this.keycloakService.getToken();
|
||||
this.keycloakUser = map2User(token);
|
||||
if (this.keycloakUser) {
|
||||
this.user = await this.userService.getByMail(this.keycloakUser.email);
|
||||
this.mailinfo.sender = { name: `${this.user.firstname} ${this.user.lastname}`, email: this.user.email, phoneNumber: this.user.email, state: this.user.companyLocation };
|
||||
}
|
||||
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'business'));
|
||||
this.listingUser = await this.userService.getById(this.listing.userId);
|
||||
this.description = this.sanitizer.bypassSecurityTrustHtml(this.listing.description);
|
||||
|
||||
@@ -49,7 +49,8 @@ export class DetailsCommercialPropertyListingComponent {
|
||||
criteria: ListingCriteria;
|
||||
mailinfo: MailInfo;
|
||||
environment = environment;
|
||||
user: KeycloakUser;
|
||||
keycloakUser: KeycloakUser;
|
||||
user: User;
|
||||
listingUser: User;
|
||||
description: SafeHtml;
|
||||
ts = new Date().getTime();
|
||||
@@ -75,7 +76,11 @@ export class DetailsCommercialPropertyListingComponent {
|
||||
|
||||
async ngOnInit() {
|
||||
const token = await this.keycloakService.getToken();
|
||||
this.user = map2User(token);
|
||||
this.keycloakUser = map2User(token);
|
||||
if (this.keycloakUser) {
|
||||
this.user = await this.userService.getByMail(this.keycloakUser.email);
|
||||
this.mailinfo.sender = { name: `${this.user.firstname} ${this.user.lastname}`, email: this.user.email, phoneNumber: this.user.email, state: this.user.companyLocation };
|
||||
}
|
||||
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'));
|
||||
this.listingUser = await this.userService.getById(this.listing.userId);
|
||||
this.description = this.sanitizer.bypassSecurityTrustHtml(this.listing.description);
|
||||
|
||||
@@ -87,7 +87,7 @@ export class AccountComponent {
|
||||
|
||||
async updateProfile(user: User) {
|
||||
await this.userService.save(this.user);
|
||||
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Acount changes have been persisted', life: 3000 });
|
||||
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Account changes have been persisted', life: 3000 });
|
||||
}
|
||||
|
||||
onUploadCompanyLogo(event: any) {
|
||||
|
||||
@@ -60,7 +60,6 @@ export class EditBusinessListingComponent {
|
||||
private id: string | undefined = this.activatedRoute.snapshot.params['id'] as string | undefined;
|
||||
user: User;
|
||||
maxFileSize = 3000000;
|
||||
uploadUrl: string;
|
||||
environment = environment;
|
||||
responsiveOptions = [
|
||||
{
|
||||
@@ -130,7 +129,6 @@ export class EditBusinessListingComponent {
|
||||
this.listing.description = this.data?.description;
|
||||
}
|
||||
}
|
||||
this.uploadUrl = `${environment.apiBaseUrl}/bizmatch/image/uploadPropertyPicture/${this.listing.id}`;
|
||||
}
|
||||
|
||||
async save() {
|
||||
|
||||
Reference in New Issue
Block a user