verified check fix

This commit is contained in:
Rudis Muiznieks 2021-06-21 19:37:35 -05:00
parent 6299a6f2d9
commit a51ca20e3f
4 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
data/*
test/data/*
.env

View File

@ -5,7 +5,7 @@ create table users (
token_expires timestamp,
pw_token text,
pw_token_expires timestamp,
verified boolean not null default false,
verified boolean not null default 0,
created timestamp not null default current_timestamp,
updated timestamp
);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use local::lib;
use utf8;
use strict;
use warnings;
@ -296,7 +297,7 @@ EOF
"Your verification token is: $token\n" .
"Run this (or equivalent) in a terminal:\n\n" .
" curl -H 'Content-Type: application/json' \\\n" .
" -XPUT -d '{\"token\",\"$token\"}' \\\n" .
" -XPUT -d '{\"token\":\"$token\"}' \\\n" .
" https://$hostname/users/$email");
print_json_response($cgi, 200, {email => $email});
}
@ -384,7 +385,7 @@ EOF
"Run this (or equivalent) in a terminal after adding your desired\n" .
"password to the appropriate field in the JSON payload:\n\n" .
" curl -H 'Content-Type: application/json' \\\n" .
" -XPUT -d '{\"password\":\"\",\"token\",\"$token\"}' \\\n" .
" -XPUT -d '{\"password\":\"\",\"token\":\"$token\"}' \\\n" .
" https://$hostname/users/$email/pwchange");
print_json_response($cgi, 200, {success => 1});
}

View File

@ -25,8 +25,8 @@
<h3>Dotplan Online</h3>
<p>Register the email address <code>test@example.com</code> with password <code>my-password-123</code> (an email with further instructions will be sent):</p>
<pre><code> curl -H 'Content-Type: application/json' \
-XPUT -d '{"password":"my-password-123"}' \
https://dotplan.online/test@example.com</code></pre>
-XPOST -d '{"password":"my-password-123"}' \
https://dotplan.online/users/test@example.com</code></pre>
<p>Retrieve an authentication token for the account created above:</p>
<pre><code> curl -H 'Accept: application/json' \
-u 'test@example.com:my-password-123' \