fix: magic link JWT (?token=) を先頭スクリプトで localStorage に保存
Made-with: Cursor
This commit is contained in:
parent
e17d2941e3
commit
e572dc710e
20
index.html
20
index.html
|
|
@ -4,6 +4,26 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<!-- JWT / init_key(Auth Gate より先に実行) -->
|
||||
<script>
|
||||
(function () {
|
||||
var u = new URLSearchParams(window.location.search);
|
||||
var token = u.get('token');
|
||||
var initKey = u.get('init_key');
|
||||
if (token) {
|
||||
localStorage.setItem('posimai_token', token);
|
||||
u.delete('token');
|
||||
}
|
||||
if (initKey) {
|
||||
localStorage.setItem('posimai_api_key', initKey);
|
||||
u.delete('init_key');
|
||||
}
|
||||
if (token || initKey) {
|
||||
var newUrl = window.location.pathname + (u.toString() ? '?' + u.toString() : '') + window.location.hash;
|
||||
window.history.replaceState({}, '', newUrl);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<!-- Auth Gate -->
|
||||
<script>
|
||||
(function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue