add auth service

This commit is contained in:
Hepatica
2023-11-25 15:05:58 +01:00
parent 32b55d4b5c
commit 999710a59f
7 changed files with 76 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
import { Post } from '../rest/RestMethods.js';
import { BackendApiUrl } from '@/properties/Сonfig.js';
export function
LogIn(authCode) {
return Post(BackendApiUrl + "/LogIn", { code: authCode }).then((data) => {
console.log(data);
return data;
}).catch(error => {
console.log(error)
});
}

View File

@@ -0,0 +1,10 @@
export function
GetAuthCodeFromCurrentPath() {
const currentPath = window.location.pathname;
const parts = currentPath.split('/');
const code = parts[parts.length - 1];
return code;
}