43 lines
697 B
Text
43 lines
697 B
Text
|
meta {
|
||
|
name: verify
|
||
|
type: http
|
||
|
seq: 2
|
||
|
}
|
||
|
|
||
|
get {
|
||
|
url: {{protocol}}//{{domain}}/user/verify?t={{verificationToken}}
|
||
|
body: json
|
||
|
auth: none
|
||
|
}
|
||
|
|
||
|
params:query {
|
||
|
t: {{verificationToken}}
|
||
|
}
|
||
|
|
||
|
body:json {
|
||
|
{
|
||
|
"username": "{{username}}",
|
||
|
"password": "{{password}}",
|
||
|
"email": "zachary@dziura.email",
|
||
|
"name": "Z. Charles Dziura"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
script:post-response {
|
||
|
const body = res.getBody();
|
||
|
const data = body.data;
|
||
|
|
||
|
if (res.status < 300) {
|
||
|
bru.setEnvVar("userId", data.userId);
|
||
|
|
||
|
if (data.auth?.token) {
|
||
|
bru.setEnvVar("authToken", data.auth.token);
|
||
|
}
|
||
|
|
||
|
if (data.session?.token) {
|
||
|
bru.setEnvVar("sessionToken", data.session.token);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|