Welcome Guest, Not a member yet? Register   Sign In
Myth:auth routes for a sub-folder / path offset app?
#1
Sad 

Have CI 4 and myth:auth both installed under a /manage sub-folder and path, along with an app for user management that works fine without authentication.
myth's register and login pages appear normal at /manage/register and /manage/login respectively, however the form POST targets are e.g. /register which of course produces a 404.
myth's src/Views/register.php:14 has:

       <form action="<?= route_to('register') ?>" method="post">
which indicates the route isn't taking account of the baseURL offset in .env:
       app.baseURL = 'https://site.domain.com/manage/'
Modifying the myth Routes.php, by inserting a path token 'manage' loses the /register form page completely, so that's not sufficient.
      $routes->group('manage', ['namespace' => 'Myth\Auth\Controllers'], function ($routes) {
I suspect this is a relatively simple issue to fix, but I'm largely ignorant of CodeIgniter's architecture and route handling.
Documentation doesn't provide much detail for patterns like this, only hints that it is possible.
What should I try next?
Reply
#2

The route_to is a named route in Myth/Auth Routes.php file.

So that's where you need to look in the Routes.php file.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(08-14-2021, 01:37 AM)InsiteFX Wrote: The route_to is a named route in Myth/Auth Routes.php file.

So that's where you need to look in the Routes.php file.
Sorry that's already known, and doesn't move any closer to a solution.
Reply
#4

maybe your basedUrl , maybe post url not match.

show some screenshot on error.
Reply
#5

Myth/Auth should be placed in the ThirdParty or the root where app and system are.
I install Myth/Auth manually in the root and can call any methods from any place without errors.
app
system
Myth
-- Auth
public
But I'm sure someone will come up with a work around, just seems like a waste of time.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB