Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening "Tracking Code Mgr" logs me out of the cp #7

Open
generator85 opened this issue Jun 23, 2023 · 8 comments
Open

Opening "Tracking Code Mgr" logs me out of the cp #7

generator85 opened this issue Jun 23, 2023 · 8 comments

Comments

@generator85
Copy link

I just installed this package, but when clicking "Tracking Code Mgr" I get logged out of the control panel.

Also the menu item "Tracking Code Mgr" doesn't have an icon, which doesn't look very good next to all the other menu items.

@simonridley
Copy link
Owner

@generator85 which version of Statamic are you using?

@generator85
Copy link
Author

The latest version (4.7.0)

@benfreke
Copy link

Just commenting here as it may be relevant. The latest version hasn't been published to packagist. But with the changes in that version (which I've attempted to apply manually) I also get logged out of the CP.

@simonridley
Copy link
Owner

Hi @benfreke and @generator85 I've updated it in Packagist now, so it's showing 1.0.1

@generator85
Copy link
Author

Yes, the issue still exists with v1.0.1

@fvanhove
Copy link

fvanhove commented Jul 6, 2023

From what I can tell the problem lies in the middleware.

The package seems to use the 'web' middleware, this middleware does not pass an authenticated cp user cookie.

Changing the middleware from web to the following solves the issue for me.

Route::middleware('statamic.cp.authenticated')->group(function () {
    Route::get('/simonridley/trackingcodemanager/', '\Simonridley\TrackingCodeManager\Http\Controllers\TrackingCodeManagerController@index')->name('simonridley.tracking-code-manager.index');
    Route::post('/simonridley/trackingcodemanager/', '\Simonridley\TrackingCodeManager\Http\Controllers\TrackingCodeManagerController@update')->name('simonridley.tracking-code-manager.update');
});

Altho this should be altered in the package source files ;-)

@generator85
Copy link
Author

Any updates on this?

@jnbn
Copy link
Contributor

jnbn commented Aug 26, 2023

Created a pr for this on #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants