Supporting invitations through geo URLs
This commit is contained in:
parent
47e0cd342e
commit
975297722a
|
@ -50,12 +50,19 @@ const User: Component<Props> = (props) => {
|
||||||
return { token: uuid(), subscriptions: [], ...values() };
|
return { token: uuid(), subscriptions: [], ...values() };
|
||||||
};
|
};
|
||||||
|
|
||||||
const invitationLink = () => {
|
const invitationLink = (type = 'https') => {
|
||||||
// TODO: make these URLs configurable
|
// TODO: make these URLs configurable
|
||||||
const configUrl = `https://admin.dyomedea.app/api/conf/${
|
if (type === 'https') {
|
||||||
getValues().token
|
const configUrl = `https://admin.dyomedea.app/api/conf/${
|
||||||
}`;
|
getValues().token
|
||||||
return `https://web.dyomedea.app#${btoa(configUrl)}`;
|
}`;
|
||||||
|
return `https://web.dyomedea.app#${btoa(configUrl)}`;
|
||||||
|
} else {
|
||||||
|
const configUrl = `https://admin.dyomedea.app/api/conf/${
|
||||||
|
getValues().token
|
||||||
|
}`;
|
||||||
|
return `geo:?invitation=${btoa(configUrl)}`;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitHandler = async (values: any, context: any) => {
|
const submitHandler = async (values: any, context: any) => {
|
||||||
|
@ -329,8 +336,12 @@ const User: Component<Props> = (props) => {
|
||||||
<h2>{userId(data('username'), data('database'))}</h2>
|
<h2>{userId(data('username'), data('database'))}</h2>
|
||||||
</Show>
|
</Show>
|
||||||
<h3>
|
<h3>
|
||||||
|
Invitations :
|
||||||
<A href={invitationLink()} target='_blank'>
|
<A href={invitationLink()} target='_blank'>
|
||||||
Invitation
|
https
|
||||||
|
</A>
|
||||||
|
<A href={invitationLink('geo')} target='_blank'>
|
||||||
|
geo
|
||||||
</A>
|
</A>
|
||||||
</h3>
|
</h3>
|
||||||
<form use:form>
|
<form use:form>
|
||||||
|
|
Loading…
Reference in New Issue