From 60b650aa093e937583c2715ca8d048b09b217ec1 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Thu, 24 Mar 2022 14:16:43 +0100 Subject: Dodat default photo id prilikom registracije. --- backend/api/api/Services/AuthService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/api/api/Services/AuthService.cs b/backend/api/api/Services/AuthService.cs index 8ef96e2e..a646cc9d 100644 --- a/backend/api/api/Services/AuthService.cs +++ b/backend/api/api/Services/AuthService.cs @@ -36,6 +36,7 @@ namespace api.Services u.Password = PasswordCrypt.hashPassword(user.password); u.FirstName = user.firstName; u.LastName = user.lastName; + u.photoId = "1"; if (_users.Find(user => user.Username == u.Username).FirstOrDefault() != null) return "Username Already Exists"; if (_users.Find(user => user.Email == u.Email).FirstOrDefault() != null) -- cgit v1.2.3 From 6039920514ea8b929178b4a152c1b6ef33d4632b Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Thu, 24 Mar 2022 15:04:32 +0100 Subject: Login - profilna slika --- frontend/src/app/_modals/login-modal/login-modal.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/_modals/login-modal/login-modal.component.ts b/frontend/src/app/_modals/login-modal/login-modal.component.ts index 1b634c9a..c86c269a 100644 --- a/frontend/src/app/_modals/login-modal/login-modal.component.ts +++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts @@ -2,6 +2,8 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { CookieService } from 'ngx-cookie-service'; import { AuthService } from 'src/app/_services/auth.service'; +import { UserInfoService } from 'src/app/_services/user-info.service'; +import shared from '../../Shared'; @Component({ selector: 'app-login-modal', @@ -18,7 +20,8 @@ export class LoginModalComponent implements OnInit { constructor( private authService: AuthService, private cookie: CookieService, - private router: Router + private router: Router, + private userInfoService: UserInfoService ) { } ngOnInit(): void { @@ -36,6 +39,9 @@ export class LoginModalComponent implements OnInit { else { this.authService.authenticate(response); (document.getElementById('closeButton')).click(); + this.userInfoService.getUserInfo().subscribe((response) => { + shared.photoId = response.photoId; + }); } }); } -- cgit v1.2.3