mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-21 13:06:02 +08:00
* [APP-1513] add disconnected msg * [APP-1513] add disconnected msg * [APP-1513] add disconnected msg
30 lines
599 B
JavaScript
30 lines
599 B
JavaScript
import API from '@ea11y-apps/global/api';
|
|
import { GOLINKS } from '@ea11y-apps/global/constants';
|
|
|
|
export const useAuth = () => {
|
|
const { subscriptionId } = 123;
|
|
|
|
const redirectToConnect = async () => {
|
|
const link = await getConnectLink();
|
|
|
|
window.open(link, '_self').focus();
|
|
};
|
|
|
|
const getConnectLink = async () => {
|
|
return API.initConnect();
|
|
};
|
|
|
|
const getUpgradeLink = () => {
|
|
const url = new URL(GOLINKS.UPGRADE);
|
|
|
|
url.searchParams.append('subscription_id', subscriptionId);
|
|
|
|
return url.toString();
|
|
};
|
|
|
|
return {
|
|
redirectToConnect,
|
|
getConnectLink,
|
|
getUpgradeLink,
|
|
};
|
|
};
|