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() };
|
||||
};
|
||||
|
||||
const invitationLink = () => {
|
||||
const invitationLink = (type = 'https') => {
|
||||
// TODO: make these URLs configurable
|
||||
if (type === 'https') {
|
||||
const configUrl = `https://admin.dyomedea.app/api/conf/${
|
||||
getValues().token
|
||||
}`;
|
||||
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) => {
|
||||
|
@ -329,8 +336,12 @@ const User: Component<Props> = (props) => {
|
|||
<h2>{userId(data('username'), data('database'))}</h2>
|
||||
</Show>
|
||||
<h3>
|
||||
Invitations :
|
||||
<A href={invitationLink()} target='_blank'>
|
||||
Invitation
|
||||
https
|
||||
</A>
|
||||
<A href={invitationLink('geo')} target='_blank'>
|
||||
geo
|
||||
</A>
|
||||
</h3>
|
||||
<form use:form>
|
||||
|
|
Loading…
Reference in New Issue