mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-13 08:46:20 +02:00
add auth service
This commit is contained in:
12
luckydiamond/src/assets/js/authentication/AuthService.js
Normal file
12
luckydiamond/src/assets/js/authentication/AuthService.js
Normal 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)
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export function
|
||||
GetAuthCodeFromCurrentPath() {
|
||||
const currentPath = window.location.pathname;
|
||||
|
||||
const parts = currentPath.split('/');
|
||||
|
||||
const code = parts[parts.length - 1];
|
||||
|
||||
return code;
|
||||
}
|
||||
Reference in New Issue
Block a user