fix: update nonce

This commit is contained in:
tim
2025-07-15 18:32:33 +08:00
parent 97d411da03
commit b245b31b36
2 changed files with 28 additions and 20 deletions

View File

@@ -1,21 +1,28 @@
<!DOCTYPE html>
<html lang="">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
referrerpolicy="no-referrer" />
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico?v=20250712">
<title><%= htmlWebpackPlugin.options.title %></title>
<script src="https://accounts.google.com/gsi/client" async defer></script>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<script src="https://accounts.google.com/gsi/client" async defer nonce="{{ CSP_NONCE_FROM_SERVER }}">
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
referrerpolicy="no-referrer" />
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico?v=20250712">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<script src="https://accounts.google.com/gsi/client" async defer></script>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -10,7 +10,8 @@ export async function googleGetIdToken() {
}
window.google.accounts.id.initialize({
client_id: GOOGLE_CLIENT_ID,
callback: ({ credential }) => resolve(credential)
callback: ({ credential }) => resolve(credential),
use_fedcm: true
})
window.google.accounts.id.prompt()
})