feat(webapp): sign-up restrictions

This commit is contained in:
a.bouhuolia
2023-05-07 23:54:42 +02:00
parent ad3c9ebfe9
commit dd26bdc482
9 changed files with 148 additions and 35 deletions

View File

@@ -2,6 +2,8 @@
import { useMutation } from 'react-query';
import useApiRequest from '../useRequest';
import { setCookie } from '../../utils';
import { useRequestQuery } from '../useQueryRequest';
import t from './types';
/**
* Saves the response data to cookies.
@@ -70,3 +72,21 @@ export const useAuthResetPassword = (props) => {
props,
);
};
/**
* Fetches the authentication page metadata.
*/
export const useAuthMetadata = (props) => {
return useRequestQuery(
[t.AUTH_METADATA_PAGE,],
{
method: 'get',
url: `auth/meta`,
},
{
select: (res) => res.data,
defaultData: {},
...props,
},
);
}

View File

@@ -1,4 +1,8 @@
// @ts-nocheck
const Authentication = {
AUTH_METADATA_PAGE: 'AUTH_META_PAGE'
}
const ACCOUNTS = {
ACCOUNT: 'ACCOUNT',
ACCOUNT_TRANSACTION: 'ACCOUNT_TRANSACTION',
@@ -217,6 +221,7 @@ const DASHBOARD = {
};
export default {
...Authentication,
...ACCOUNTS,
...BILLS,
...VENDORS,