<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Plack::App::ChangePassword - Plack change password application.

SYNOPSIS
     use Plack::App::ChangePassword;

     my $obj = Plack::App::ChangePassword-&gt;new(%parameters);
     my $psgi_ar = $obj-&gt;call($env);
     my $app = $obj-&gt;to_app;

METHODS
  "new"
     my $obj = Plack::App::ChangePassword-&gt;new(%parameters);

    Constructor.

    *       "author"

            Author string to HTML head.

            Default value is undef.

    *       "change_password_cb"

            Callback for main changing of password. Arguments for callback
            are: $env, $old_password and $password. Returns 0/1 for
            (un)successful changing of password.

            Default value is undef.

    *       "content_type"

            Content type for output.

            Default value is 'text/html; charset=__ENCODING__'.

    *       "css"

            Instance of CSS::Struct::Output object.

            Default value is CSS::Struct::Output::Raw instance.

    *       "css_init"

            Reference to array with CSS::Struct structure.

            Default value is CSS initialization from Tags::HTML::Page::Begin
            like

             * {
                    box-sizing: border-box;
                    margin: 0;
                    padding: 0;
             }

    *       "encoding"

            Set encoding for output.

            Default value is 'utf-8'.

    *       "favicon"

            Link to favicon.

            Default value is undef.

    *       "flag_begin"

            Flag that means begin of html writing via
            Tags::HTML::Page::Begin.

            Default value is 1.

    *       "flag_end"

            Flag that means end of html writing via Tags::HTML::Page::End.

            Default value is 1.

    *       "generator"

            HTML generator string.

            Default value is 'Plack::App::ChangePassword; Version:
            __VERSION__'.

    *       "message_cb"

            Callback to process message from application. Arguments for
            callback are: $env, $message_type and $message. Returns undef.

            Default value is undef.

    *       "psgi_app"

            PSGI application to run instead of normal process. Intent of
            this is change application in "_process_actions" method.

            Default value is undef.

    *       "redirect_change_password"

            Redirect URL after successful password changed.

            Default value is undef.

    *       "redirect_error"

            Redirect URL after error in changing of password.

            Default value is undef.

    *       "script_js"

            Reference to array with Javascript code strings.

            Default value is [].

    *       "script_js_src"

            Reference to array with Javascript URLs.

            Default value is [].

    *       "status_code"

            HTTP status code.

            Default value is 200.

    *       "tags"

            Instance of Tags::Output object.

            Default value is

             Tags::Output::Raw-&gt;new(
                     'xml' =&gt; 1,
                     'no_simple' =&gt; ['script', 'textarea'],
                     'preserved' =&gt; ['pre', 'style'],
             );

    *       "title"

            Page title.

            Default value is 'Change password page'.

    Returns instance of object.

  "call"
     my $psgi_ar = $obj-&gt;call($env);

    Implementation of login page.

    Returns reference to array (PSGI structure).

  "to_app"
     my $app = $obj-&gt;to_app;

    Creates Plack application.

    Returns Plack::Component object.

EXAMPLE
     use strict;
     use warnings;

     use CSS::Struct::Output::Indent;
     use Plack::App::ChangePassword;
     use Plack::Runner;
     use Tags::Output::Indent;

     # Run application.
     my $app = Plack::App::ChangePassword-&gt;new(
             'css' =&gt; CSS::Struct::Output::Indent-&gt;new,
             'generator' =&gt; 'Plack::App::ChangePassword',
             'tags' =&gt; Tags::Output::Indent-&gt;new(
                     'preserved' =&gt; ['style'],
                     'xml' =&gt; 1,
             ),
     )-&gt;to_app;
     Plack::Runner-&gt;new-&gt;run($app);

     # Output:
     # HTTP::Server::PSGI: Accepting connections at http://0:5000/

     # &gt; curl http://localhost:5000/
     # &lt;!DOCTYPE html&gt;
     # &lt;html lang="en"&gt;
     #   &lt;head&gt;
     #     &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
     #     &lt;meta name="generator" content="Plack::App::ChangePassword" /&gt;
     #     &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
     #     &lt;title&gt;
     #       Change password page
     #     &lt;/title&gt;
     #     &lt;style type="text/css"&gt;
     # * {
     #      box-sizing: border-box;
     #      margin: 0;
     #      padding: 0;
     # }
     # .form-change-password {
     #      width: 300px;
     #      background-color: #f2f2f2;
     #      padding: 20px;
     #      border-radius: 5px;
     #      box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
     # }
     # .form-change-password fieldset {
     #      border: none;
     #      padding: 0;
     #      margin-bottom: 20px;
     # }
     # .form-change-password legend {
     #      font-weight: bold;
     #      margin-bottom: 10px;
     # }
     # .form-change-password p {
     #      margin: 0;
     #      padding: 10px 0;
     # }
     # .form-change-password label {
     #      display: block;
     #      font-weight: bold;
     #      margin-bottom: 5px;
     # }
     # .form-change-password input[type="text"], .form-change-password input[type="password"] {
     #      width: 100%;
     #      padding: 8px;
     #      border: 1px solid #ccc;
     #      border-radius: 3px;
     # }
     # .form-change-password button[type="submit"] {
     #      width: 100%;
     #      padding: 10px;
     #      background-color: #4CAF50;
     #      color: #fff;
     #      border: none;
     #      border-radius: 3px;
     #      cursor: pointer;
     # }
     # .form-change-password button[type="submit"]:hover {
     #      background-color: #45a049;
     # }
     # .form-change-password .messages {
     #      text-align: center;
     # }
     # .container {
     #      display: flex;
     #      align-items: center;
     #      justify-content: center;
     #      height: 100vh;
     # }
     # &lt;/style&gt;
     #   &lt;/head&gt;
     #   &lt;body&gt;
     #     &lt;div class="container"&gt;
     #       &lt;div class="inner"&gt;
     #         &lt;form class="form-change-password" method="post"&gt;
     #           &lt;fieldset&gt;
     #             &lt;legend&gt;
     #               Change password
     #             &lt;/legend&gt;
     #             &lt;p&gt;
     #               &lt;label for="old_password"&gt;
     #                 Old password
     #               &lt;/label&gt;
     #               &lt;input type="password" name="old_password" id="old_password"
     #                 autofocus="autofocus" /&gt;
     #             &lt;/p&gt;
     #             &lt;p&gt;
     #               &lt;label for="password1"&gt;
     #                 New password
     #               &lt;/label&gt;
     #               &lt;input type="password" name="password1" id="password1" /&gt;
     #             &lt;/p&gt;
     #             &lt;p&gt;
     #               &lt;label for="password2"&gt;
     #                 Confirm new password
     #               &lt;/label&gt;
     #               &lt;input type="password" name="password2" id="password2" /&gt;
     #             &lt;/p&gt;
     #             &lt;p&gt;
     #               &lt;button type="submit" name="change_password" value=
     #                 "change_password"&gt;
     #                 Save Changes
     #               &lt;/button&gt;
     #             &lt;/p&gt;
     #           &lt;/fieldset&gt;
     #         &lt;/form&gt;
     #       &lt;/div&gt;
     #     &lt;/div&gt;
     #   &lt;/body&gt;
     # &lt;/html&gt;

DEPENDENCIES
    Plack::Component::Tags::HTML, Plack::Request, Plack::Response,
    Plack::Session, Plack::Util::Accessor, Tags::HTML::ChangePassword,
    Tags::HTML::Container.

SEE ALSO
    Plack::App::Login
        Plack login application.

    Plack::App::Login::Password
        Plack login/password application.

    Plack::App::Register
        Plack register application.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/Plack-App-ChangePassword&gt;

AUTHOR
    Michal Josef �麖a�嶤k &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    穢 2024 Michal Josef �麖a�嶤k

    BSD 2-Clause License

VERSION
    0.03

</pre></body></html>