diff --git a/src/api/fetchCookie.ts b/src/api/fetchCookie.ts index d531ad2c1a0ae6fd2074300c38dfcc951c8f87f1..de99b415d2982d9630153ea1306035fd0b7937fc 100644 --- a/src/api/fetchCookie.ts +++ b/src/api/fetchCookie.ts @@ -1,9 +1,10 @@ import axios from 'axios'; /** + * @async * Call for csrf cookie. This cookie is the user session identifier and * must be sent during the login process. - * @returns csrf cookie + * @returns {string} csrf cookie */ export const fetchCookie = async (): Promise<string> => axios('/api/web/csrf').then((res) => res.data.token); diff --git a/src/api/getRole.ts b/src/api/getRole.ts index cb06049debab84ddb437b373319a1c910d611ccc..395a0350e5d568b7dc2f300870f9d42ef495fb79 100644 --- a/src/api/getRole.ts +++ b/src/api/getRole.ts @@ -1,8 +1,9 @@ import axios from 'axios'; /** + * @async * Asks for the current set role. - * @returns empty if the role is not set or a name between those defined + * @returns {string} empty if the role is not set or a name between those defined * in {@see userRoles} */ export const getRole = async (): Promise<string> => diff --git a/src/api/getRoles.ts b/src/api/getRoles.ts index 7e00e4ef213203b003e3f01e5e4c82981a05c9d8..2d3983e47e2d27ee3331a8dc9675800bb4f0ca56 100644 --- a/src/api/getRoles.ts +++ b/src/api/getRoles.ts @@ -1,8 +1,9 @@ import axios from 'axios'; /** + * @async * Ask the server all the roles of an user if the user has multiple roles. - * @returns array of roles. + * @returns {string[]} array of roles. */ export const getRoles = async (): Promise<string[]> => axios('/api/web/login/get_roles').then((res) => res.data.roles); diff --git a/src/api/isAuthenticated.ts b/src/api/isAuthenticated.ts index 041b4be81d010544d23c5515ef4ea15808f70aa4..ab8dc20cff1d753fd14c4596106328ef93983d2f 100644 --- a/src/api/isAuthenticated.ts +++ b/src/api/isAuthenticated.ts @@ -1,8 +1,9 @@ import axios from 'axios'; /** + * @async * Ask the server if the user is authenticated. - * @returns true or false if the user is authenticated. + * @returns {boolean} true or false if the user is authenticated. */ export const isAuthenticated = async (): Promise<boolean> => axios('/api/web/login/is_authenticated').then( diff --git a/src/api/setRole.ts b/src/api/setRole.ts index ac08f6f5bbbfa6ab9963b23f09b07ad7c05a0965..27087fb3697344e4899db8860a77e82168450f9f 100644 --- a/src/api/setRole.ts +++ b/src/api/setRole.ts @@ -1,7 +1,9 @@ import axios from 'axios'; /** + * @async * Set the role of the user in the database. + * @return {string} role */ export const setRole = async (role: string): Promise<void> => axios.post('/api/web/login/set_role', { role });