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

Content Security Policy Nonce #17

Open
eliasjtg opened this issue Feb 20, 2021 · 0 comments
Open

Content Security Policy Nonce #17

eliasjtg opened this issue Feb 20, 2021 · 0 comments

Comments

@eliasjtg
Copy link

My server has Content Security Policy enabled, i want to initialize js code with a nonce to allow recaptcha script execution.

Google docs recommend use nonce: FAQ

Can be added a function called initJsNonce() or related?

    /**
     * @param string $nonce
     * @return string
     */
    public function initJsNonce(string $nonce): string
    {
        return '<script src="' . $this->origin . '/api.js?render=' . $this->sitekey . '" nonce="'.$nonce.'"></script>';
    }

As workaround how can add/override RecaptchaV3 class to add this?

I'm not familiarized with Laravel Container to do that, if anyone can help me I would appreciate.

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

1 participant