Add auth provider

This commit is contained in:
Hepatica
2023-11-25 21:56:01 +01:00
parent 041c54c4ac
commit 28b3846ec7
4 changed files with 75 additions and 42 deletions

View File

@@ -1,12 +1,21 @@
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)
});
}
// export function
// LogIn(authCode) {
// return Post(BackendApiUrl + "/LogIn", { code: authCode }).then((data) => {
// console.log(data);
// return data;
// }).catch(error => {
// console.log(error)
// });
// }
export async function LogIn(authCode) {
try {
const response = await Post(BackendApiUrl + "/Authorize/LogIn", { code: authCode });
console.log(response);
return response;
} catch (error) {
console.error('Ошибка в LogIn:', error);
}
}