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

View File

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