PageSourceSearch

https://cojicaji.jp/assets/auth/password_reset_form-539b5834.js

js cojicaji.jp collected 2026-10-04 00:12:02 UTC 1,844 bytes, 62 lines download raw bytes

1/**
2 * パスワードリセットフォーム
3 * 自己完結型: turbo:loadで自動初期化
4 *
5 * Note: Firebase CDN (compat mode) はグローバル変数 window.firebase を提供します
6 */
7var Auth = Auth || window.Auth || {};
8
9(function() {
10  /**
11   * パスワードリセットフォームを初期化
12   */
13  function initPasswordResetForm() {
14    const passwordResetButton = document.getElementById('js-user-password-reset-button');
15    if (!passwordResetButton) return;
16
17    // Firebase初期化
18    if (!Auth.FirebaseUtil.initFirebase()) {
19      console.error('Firebase initialization failed');
20      return;
21    }
22
23    // イベントリスナー登録
24    passwordResetButton.addEventListener('click', function(e) {
25      e.preventDefault();
26      sendPasswordResetEmail();
27    });
28  }
29
30  /**
31   * パスワードリセットメールを送信
32   */
33  function sendPasswordResetEmail() {
34    const emailField = document.querySelector("input[name='email']");
35    if (!emailField) return;
36
37    const email = emailField.value;
38
39    if (!email) {
40      Auth.FormHelper.clearErrorMessages();
41      Auth.FormHelper.showErrorMessage("メールアドレスを入力してください");
42      return;
43    }
44
45    // Firebase CDN (compat mode) のグローバル変数を使用
46    const actionCodeSettings = null;
47    firebase.auth().sendPasswordResetEmail(email, actionCodeSettings)
48      .then(function() {
49        window.location.href = "/sent_password_resets";
50      })
51      .catch(function(error) {
52        const errorMessage = Auth.FirebaseUtil.getFirebaseErrorMessage(error.code);
53        Auth.FormHelper.clearErrorMessages();
54        Auth.FormHelper.showErrorMessage(errorMessage);
55      });
56  }
57
58  // turbo:load で自動初期化
59  document.addEventListener('turbo:load', initPasswordResetForm);
60})();
61
62window.Auth = Auth;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.