ref: change auth setting in Login Screen
This commit is contained in:
parent
9d31ea245c
commit
12c90ff120
26 changed files with 1149 additions and 99 deletions
19
package/config/api/Admin/auth/GetToken/page.tsx
Normal file
19
package/config/api/Admin/auth/GetToken/page.tsx
Normal 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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue