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/* data/*
test/data/* test/data/*
.env

View File

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

View File

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

View File

@ -25,8 +25,8 @@
<h3>Dotplan Online</h3> <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> <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' \ <pre><code> curl -H 'Content-Type: application/json' \
-XPUT -d '{"password":"my-password-123"}' \ -XPOST -d '{"password":"my-password-123"}' \
https://dotplan.online/test@example.com</code></pre> https://dotplan.online/users/test@example.com</code></pre>
<p>Retrieve an authentication token for the account created above:</p> <p>Retrieve an authentication token for the account created above:</p>
<pre><code> curl -H 'Accept: application/json' \ <pre><code> curl -H 'Accept: application/json' \
-u 'test@example.com:my-password-123' \ -u 'test@example.com:my-password-123' \