realm => 'restricted area',
token_max_age => 60 * 60 * 24,
username_regex => qr/^\w{2,20}$/a,
- register_url => '/register',
- passwd_url => '/passwd',
- request_reset_url => '/request-reset',
- reset_url => '/reset'
+ register_url => '/action/register',
+ passwd_url => '/action/passwd',
+ request_reset_url => '/action/request-reset',
+ reset_url => '/action/reset'
)}
sub new {
=over
-=item B<POST> /register?username=user&password=pw&confirm_password=pw&email=user@example.org
+=item B<POST> /action/register?username=user&password=pw&confirm_password=pw&email=user@example.org
This URL creates a new user with the given username, password and
email. The two passwords must match, the user must match
C<username_regex> and the user must not already exist.
-=item B<POST> /passwd?password=oldpw&new_password=newpw&confirm_new_password=newpw
+=item B<POST> /action/passwd?password=oldpw&new_password=newpw&confirm_new_password=newpw
This URL changes the password of a user. The user must be
authenticated (otherwise the endpoint will return 401).
-=item B<POST> /request-reset?username=user
+=item B<POST> /action/request-reset?username=user
This URL requests a password reset token for the given user. The token
will be sent to the user's email address.
A reset token in the default implementation is C<< base64(HMAC-SHA1("$username $passphrase $expiration_unix_time")) . ":$expiration_user_time" >>.
-=item B<POST> /reset?username=user&new_password=pw&confirm_new_password=pw&token=token
+=item B<POST> /action/reset?username=user&new_password=pw&confirm_new_password=pw&token=token
This URL performs a password reset.
=item register_url
-URL for registering. Defaults to C<'/register'>.
+URL for registering. Defaults to C<'/action/register'>.
=item passwd_url
-URL for changing your password. Defaults to C<'/passwd'>.
+URL for changing your password. Defaults to C<'/action/passwd'>.
=item request_reset_url
URL for requesting a password reset token by email. Defaults to
-C<'/request-reset'>.
+C<'/action/request-reset'>.
=item reset_url
URL for resetting your password with a reset token. Defaults to
-C<'/reset'>.
+C<'/action/reset'>.
=back