Skip to content

Commit 98d092c

Browse files
Revert "feat: TT-577 get profile pic from Google account (#825)" (#829)
This reverts commit 3bee7e3. Co-authored-by: Carlos Carvajal <[email protected]>
1 parent 4c48be4 commit 98d092c

File tree

5 files changed

+9
-25
lines changed

5 files changed

+9
-25
lines changed

src/app/modules/login/services/login.service.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
22
import { TestBed } from '@angular/core/testing';
3-
import {SocialAuthService, SocialUser} from 'angularx-social-login';
3+
import { SocialAuthService } from 'angularx-social-login';
44
import { CookieService } from 'ngx-cookie-service';
55
import { of } from 'rxjs';
66

@@ -13,9 +13,6 @@ describe('LoginService', () => {
1313
let socialAuthService: SocialAuthService;
1414
let account;
1515
const socialAuthServiceStub = jasmine.createSpyObj('SocialAuthService', ['signOut', 'signIn']);
16-
socialAuthServiceStub.signIn.and.returnValue(new Promise<SocialUser>( resolve => {
17-
return {photoUrl: ''};
18-
}));
1916
const cookieStoreStub = {};
2017

2118
beforeEach(() => {

src/app/modules/login/services/login.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ export class LoginService {
2020
}
2121

2222
signIn() {
23-
this.socialAuthService.signIn(GoogleLoginProvider.PROVIDER_ID).then(user => {
24-
localStorage.setItem('googleUserPhoto', user.photoUrl);
25-
});
23+
this.socialAuthService.signIn(GoogleLoginProvider.PROVIDER_ID);
2624
}
2725
logout() {
2826
this.socialAuthService.signOut();
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class=" py-8 flex items-center pl-3">
2-
<img [src]="userPhoto" alt="user-icon" class="round"/>
2+
<img src="assets/icons/user.svg" alt="user-icon" width="40" height="40"/>
33
<span class="pl-1">
4-
<h2 class="font-poppins text-base font-semibold pl-2 dark:text-whiteTW">{{ userName }}</h2>
5-
<p class="font-poppins mt-1 text-xs font-medium pl-2 text-grayTW dark:text-whiteTW">{{ userEmail }}</p>
4+
<h2 class="font-poppins text-base font-semibold pl-2 dark:text-whiteTW">{{userName}}</h2>
5+
<p class="font-poppins mt-1 text-xs font-medium pl-2 text-grayTW dark:text-whiteTW">{{userEmail}}</p>
66
</span>
7-
</div>
7+
</div>

src/app/modules/shared/components/user/user.component.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
@import '../../../../../styles/colors.scss';
22

3-
.round {
4-
width:40px;
5-
height:40px;
6-
border-radius:150px;
7-
}
8-
93
.user-profile {
104
color: black;
115
cursor: pointer;

src/app/modules/shared/components/user/user.component.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,25 @@ import { LoginService } from '../../../login/services/login.service';
99
styleUrls: ['./user.component.scss'],
1010
})
1111
export class UserComponent implements OnInit {
12-
userPhoto: string;
1312
userName: string;
1413
userEmail: string;
1514
isProduction = environment.production;
1615

17-
constructor(
18-
private azureAdB2CService: AzureAdB2CService,
19-
private loginService: LoginService
20-
) { }
16+
constructor(private azureAdB2CService: AzureAdB2CService, private loginService: LoginService) {}
2117

2218
ngOnInit(): void {
23-
if (this.isProduction) {
19+
if (this.isProduction){
2420
if (this.azureAdB2CService.isLogin()) {
2521
this.userName = this.azureAdB2CService.getName();
2622
this.userEmail = this.azureAdB2CService.getUserEmail();
2723
this.azureAdB2CService.setTenantId();
2824
}
29-
} else {
25+
}else{
3026
if (this.loginService.isLogin()) {
3127
this.userName = this.loginService.getName();
3228
this.userEmail = this.loginService.getUserEmail();
3329
this.azureAdB2CService.setTenantId();
3430
}
3531
}
36-
this.userPhoto = localStorage.getItem('googleUserPhoto');
3732
}
3833
}

0 commit comments

Comments
 (0)