34 lines
731 B
JavaScript
34 lines
731 B
JavaScript
import { get, post } from './modules/fetchManager';
|
|
|
|
let token = '';
|
|
|
|
async function main() {
|
|
let res = await post('http://127.0.0.1:1109/api/users/register', {
|
|
username:
|
|
'emerald',
|
|
email:
|
|
'light_emerald@aostia.com',
|
|
password:
|
|
'test1234',
|
|
first_name:
|
|
'Emerald',
|
|
last_name:
|
|
'Light',
|
|
});
|
|
console.log(res);
|
|
|
|
res = await post('http://127.0.0.1:1109/api/users/login', {
|
|
usernameOrEmail: 'emerald',
|
|
password: 'test1234',
|
|
});
|
|
console.log(res);
|
|
token = res.JSON.token;
|
|
|
|
res = await get('http://127.0.0.1:1109/api/users/email/request', token);
|
|
console.log(res);
|
|
|
|
res = await get('http://127.0.0.1:1109/api/users/email/verify?code=345708', token);
|
|
console.log(res);
|
|
}
|
|
|
|
main(); |