Skip to content

Bug: Bad redirection in the registration process (auth/a/show and auth/a/verify) #879

@ms1495

Description

@ms1495

PHP Version

8.2.10

CodeIgniter4 Version

4.4.1

Shield Version

1.0.0-beta.6

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB 11.1

Did you customize Shield?

No

What happened?

When the shield routes are defined as following:

  $routes->group('{locale}/account', static function($routes) {
    service('auth')->routes($routes);
  });

some URLS are not generated correctly in the registration process:

Steps to Reproduce

  1. Rewrite the shield routes to include locale and a top level
  2. Try to register a new user

Expected Output

Correct redirection and form submitted to the right URL.

Anything else?

A possible solution is to make a fix in two files:

  • In Controllers\RegistrerController.php:
    change: return redirect()->to('auth/a/show');
    into: return redirect()->route('auth-action-show');
  • In Views\email_activate_show.php
    change: <form action="<?= site_url('auth/a/verify') ?>" method="post">
    into: <form action="<?= url_to('auth-action-verify') ?>" method="post">

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions