Refused to apply inline style because it violates the following Content Security Policy directive #122
Unanswered
viveksudalai
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Here are a few things you could check:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Try to add 'unsafe-inline' $this->addDirective(Directive::STYLE, ['self', 'unsafe-inline', 'http://127.0.0.1:8002/adminapp/js/app.js', 'https://fonts.gstatic.com', 'https://fonts.googleapis.com/css2', 'https://fonts.googleapis.com/css', 'https://cdnjs.cloudflare.com', 'https://cdn.jsdelivr.net', 'https://static.opentok.com']); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-QflBjTXURnTw3IiyZ6V4FAcW7ROaxQmB' http://127.0.0.1:8002/adminapp/js/app.js https://fonts.gstatic.com https://fonts.googleapis.com/css2 https://fonts.googleapis.com/css https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://static.opentok.com". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.
i have created my own policy and added in the config/csp.php file and added the nonce in the login.blade.php file. But i am getting above error.
My csp.php file
'policy' => App\Http\Policies\CSPExtended::class,
My CSPExtended File
class CSPExtended extends Basic
{
public function configure()
{
parent::configure();
}
Login.php
<style nonce="{{ csp_nonce() }}"> :root { --background: #3e91c4; --background-faded: #E5F4FA; --background-faded-75: #3e91c475; --background-faded-25: #3e91c425; --btn-color: #3e91c4; }Beta Was this translation helpful? Give feedback.
All reactions