mirror of
https://github.com/StepanovPlaton/torrent_frontend.git
synced 2026-04-04 04:40:50 +04:00
Work on game edit
This commit is contained in:
@@ -11,10 +11,10 @@ import Cookies from "js-cookie";
|
||||
|
||||
export abstract class UserService {
|
||||
public static async Login(loginForm: LoginForm) {
|
||||
const accessToken = await HTTPService.post<TokenResponse>(
|
||||
const accessToken = await HTTPService.post(
|
||||
"/auth",
|
||||
new URLSearchParams(Object.entries(loginForm)),
|
||||
tokenResponseSchema,
|
||||
new URLSearchParams(Object.entries(loginForm)),
|
||||
{
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
}
|
||||
@@ -31,6 +31,10 @@ export abstract class UserService {
|
||||
}
|
||||
}
|
||||
|
||||
public static GetToken(): string | undefined {
|
||||
return Cookies.get("access-token");
|
||||
}
|
||||
|
||||
public static IdentifyYourself(): TokenData | undefined {
|
||||
const token = Cookies.get("access-token");
|
||||
if (token) {
|
||||
|
||||
Reference in New Issue
Block a user