Request failed with status code 403: Unauthorized. #353
Replies: 5 comments 7 replies
-
Hey @haris-pixleedge From my experience this is most likely to do with "stateful domains". By default, it will only allow access from the domain (or subdomain) defined in the Here's what you should do:
LOG_VIEWER_API_STATEFUL_DOMAINS=example.com,www.example.com OR, just update your Let me know how it goes! |
Beta Was this translation helpful? Give feedback.
-
Hey @arukompas I had a similar problem with Laravel 10 / PHP 8.2. I kept getting error 500 while loading the index page: I had to disable \Opcodes\LogViewer\Http\Middleware\EnsureFrontendRequestsAreStateful::class, in the log-viewer.php file to get it to work. These are the traces of the 500 error: After deactivating that middleware, everything worked fine. Thanks for your great job. Next step is makint it multi-language! Jordi |
Beta Was this translation helpful? Give feedback.
-
I had a same problem, I was able to open /log-viewer, but giving me 403. I fixed it partially. I have updated my log-viewer package, but my I had to remove AuthorizeLogViewer, if it is there, I am still getting 403. So I replaced it with auth, role:Admin. Now I am able to access the page, but in that logs list on left it is still 403. So it is failing now on API.
If I comment out AuthorizeLogViewer also there, it is working fine, but if I open API url in incognito, I can see JSON data:
My .env:
Logs are accesible from https://example.com/log-viewer, nothing crazy, no subdomains. I understand that logs are not protected now, but I cannot figure out how to make it work. 😵 Installed Version: v3.12.0 |
Beta Was this translation helpful? Give feedback.
-
For me issue was that
|
Beta Was this translation helpful? Give feedback.
-
Log viewer working fine on localhost but get Unauthorized error on production although route is working but can't see the log file due to error.
I've also added the Log viewer Auth to restrict the access in AppServiceProvider:
LogViewer::auth(function ($request) { return $request->user() && in_array($request->user()->email, [ 'haris.zahid@example.com', ]); });
Here is my config/log-viewer file:
`<?php
return [
];
`
Beta Was this translation helpful? Give feedback.
All reactions