update: google oauth2.0 with hd=email@forth.co.th only now functional
This commit is contained in:
parent
984707c7bf
commit
36c71eda38
31 changed files with 580 additions and 317 deletions
|
|
@ -1,4 +1,9 @@
|
|||
<p>dashboard works!</p>
|
||||
<div *ngIf="userInfo">
|
||||
<img [src]="userInfo.image" />
|
||||
<p>Hi {{ userInfo.username }}</p>
|
||||
<p>Your email is {{ userInfo.email }}</p>
|
||||
</div>
|
||||
<button (click)="logout()" class="bg-blue-300 rounded-lg min-w-fit p-10">
|
||||
Logout
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,29 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UserService } from 'src/app/core/services/user.service';
|
||||
import { SocialAuthService } from '@abacritt/angularx-social-login';
|
||||
import { Router } from '@angular/router';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { User } from 'src/app/core/models/user.model';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
standalone: true,
|
||||
imports: [NgIf],
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrls: ['./dashboard.component.css'],
|
||||
})
|
||||
export class DashboardComponent {
|
||||
export class DashboardComponent implements OnInit {
|
||||
userInfo: User | null = null;
|
||||
|
||||
constructor(private _userService: UserService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._userService.currentUser.subscribe((user) => {
|
||||
this.userInfo = user;
|
||||
});
|
||||
}
|
||||
|
||||
logout() {
|
||||
console.log('logout');
|
||||
this._userService.logout();
|
||||
// this._authService.signOut();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue