From 388ed2817a2e23c00f50d3d74d71c96c3d466a5a Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 1 Mar 2015 12:55:29 +0200 Subject: [PATCH] Change default intercepted URLs --- lib/Plack/Middleware/Auth/Complex.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Plack/Middleware/Auth/Complex.pm b/lib/Plack/Middleware/Auth/Complex.pm index 0f6759d..920810c 100644 --- a/lib/Plack/Middleware/Auth/Complex.pm +++ b/lib/Plack/Middleware/Auth/Complex.pm @@ -28,10 +28,10 @@ sub default_opts {( 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 { @@ -275,25 +275,25 @@ error and 500 for server errors. All parameters are mandatory. =over -=item B /register?username=user&password=pw&confirm_password=pw&email=user@example.org +=item B /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 and the user must not already exist. -=item B /passwd?password=oldpw&new_password=newpw&confirm_new_password=newpw +=item B /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 /request-reset?username=user +=item B /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 /reset?username=user&new_password=pw&confirm_new_password=pw&token=token +=item B /action/reset?username=user&new_password=pw&confirm_new_password=pw&token=token This URL performs a password reset. @@ -359,21 +359,21 @@ C. =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 -- 2.39.2