|
|
@ -8,6 +8,8 @@ import {Router} from "@angular/router"; |
|
|
|
import {map, Observable} from "rxjs"; |
|
|
|
import {HttpClient} from "@angular/common/http"; |
|
|
|
import {DiscordAccount} from "../entities/DiscordAccount"; |
|
|
|
import {MatDialog} from "@angular/material/dialog"; |
|
|
|
import {AuthDialogRequest} from "../pages/internal-components/dialogs/AuthDialogRequest"; |
|
|
|
|
|
|
|
export interface StorageUser {steamdata: SteamData|null, steamIds: SteamIDs|null, permition: Permition|null} |
|
|
|
|
|
|
@ -20,7 +22,10 @@ export class AuthService { |
|
|
|
steamIds: SteamIDs | null = null; |
|
|
|
permition: Permition | null = null; |
|
|
|
|
|
|
|
constructor(private playerService: PlayerService, private router: Router, private http: HttpClient) { |
|
|
|
constructor(private playerService: PlayerService, |
|
|
|
private router: Router, |
|
|
|
private http: HttpClient, |
|
|
|
private dialog: MatDialog) { |
|
|
|
this.playerService.getProfile(null, [ProfileRequestData.POHUY]).subscribe( |
|
|
|
() => { |
|
|
|
if (sessionStorage.getItem(AuthService.KEY) == null) { |
|
|
@ -75,6 +80,7 @@ export class AuthService { |
|
|
|
|
|
|
|
searchPlayer(account: number|string|undefined) { |
|
|
|
if (!this.isAuth()) { |
|
|
|
this.dialog.open(AuthDialogRequest); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|