removes reliance on useAsTitle

This commit is contained in:
James
2020-05-18 13:07:32 -04:00
parent 8a1d489f4b
commit 8809bcb573
15 changed files with 34 additions and 95 deletions

View File

@@ -1,17 +1,16 @@
require('isomorphic-fetch');
const server = require('../../demo/server');
const config = require('../../demo/payload.config');
const { email, password } = require('./credentials');
const { username, password } = require('./credentials');
const url = config.serverURL;
const usernameField = config.User.auth.useAsUsername;
const globalSetup = async () => {
global.PAYLOAD_SERVER = server.start();
const response = await fetch(`${url}/api/first-register`, {
body: JSON.stringify({
[usernameField]: email,
username,
password,
roles: ['admin', 'user'],
}),