Adding a token in user definition
This commit is contained in:
parent
f77f7b5ea5
commit
77af32068c
|
@ -21,6 +21,7 @@ import { userExists } from '~/lib/user-exists';
|
|||
import { update } from '~/lib/update';
|
||||
import { replicationDocument } from '~/lib/replication-document';
|
||||
import { get } from '~/lib/get';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
interface Props {
|
||||
values?: () => any;
|
||||
|
@ -44,9 +45,9 @@ const User: Component<Props> = (props) => {
|
|||
|
||||
const getValues = () => {
|
||||
if (isNew()) {
|
||||
return { database, subscriptions: [] };
|
||||
return { database, subscriptions: [], token: uuid() };
|
||||
}
|
||||
return { subscriptions: [], ...values() };
|
||||
return { token: uuid(), subscriptions: [], ...values() };
|
||||
};
|
||||
|
||||
const submitHandler = async (values: any, context: any) => {
|
||||
|
|
Loading…
Reference in New Issue