verified check fix

main
Rudis Muiznieks 1 year ago
parent 6299a6f2d9
commit a51ca20e3f
  1. 1
      .gitignore
  2. 2
      schema.sql
  3. 5
      server.pl
  4. 4
      static/index.html

1
.gitignore vendored

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

@ -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
);

@ -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});
}

@ -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' \

Loading…
Cancel
Save