ref: change auth setting in Login Screen

This commit is contained in:
Luis Felipe Cadavid 2024-09-24 17:35:35 -05:00
parent 9d31ea245c
commit 12c90ff120
26 changed files with 1149 additions and 99 deletions

View file

@ -0,0 +1,19 @@
import { auth } from "@package/config/api/Auth/page"
import { API_PASS_SERVICE, API_USER_TOKEN_SERVICE } from "@package/utils/Constants"
/**
* Retrieves an authentication token using the provided user token service and password service.
*
* @returns {Promise<any>} The authentication token.
* @throws {Error} If `API_USER_TOKEN_SERVICE` or `API_PASS_SERVICE` is undefined.
*/
export async function GetToken() {
try {
if (!API_USER_TOKEN_SERVICE || !API_PASS_SERVICE) {
throw new Error("API_USER_TOKEN_SERVICE or API_PASS_SERVICE is undefined");
}
return await auth(API_USER_TOKEN_SERVICE, API_PASS_SERVICE)
} catch (error) {
console.error('error' + error)
}
}