|
166 | 166 | </body> |
167 | 167 | <script type="module"> |
168 | 168 | import $ from "jquery"; |
169 | | - import { _Auth as Auth } from "./ts/firebase"; |
170 | 169 | import { |
171 | 170 | applyActionCode, |
172 | 171 | verifyPasswordResetCode, |
173 | 172 | confirmPasswordReset, |
174 | 173 | checkActionCode, |
175 | 174 | sendPasswordResetEmail, |
176 | 175 | signInWithEmailAndPassword, |
| 176 | + getAuth, |
177 | 177 | } from "firebase/auth"; |
| 178 | + import { initializeApp } from "firebase/app"; |
| 179 | + import { firebaseConfig } from "./ts/constants/firebase-config"; |
| 180 | + |
| 181 | + const app = initializeApp(firebaseConfig); |
| 182 | + const Auth = getAuth(app); |
178 | 183 |
|
179 | 184 | function isPasswordStrong(password) { |
180 | 185 | const hasCapital = !!password.match(/[A-Z]/); |
|
199 | 204 | $("main .preloader .subText").text(`You can now close this tab`); |
200 | 205 | }) |
201 | 206 | .catch((error) => { |
| 207 | + console.error(error); |
202 | 208 | $("main .preloader .icon").html(`<i class="fas fa-fw fa-times"></i>`); |
203 | | - $("main .preloader .text").text(error.message); |
204 | | - |
| 209 | + $("main .preloader .text").text( |
| 210 | + `Fatal error: ${error.message}. If this issue persists, please report it.` |
| 211 | + ); |
205 | 212 | // Code is invalid or expired. Ask the user to verify their email address |
206 | 213 | // again. |
207 | 214 | }); |
|
255 | 262 | signInWithEmailAndPassword(Auth, accountEmail, newPassword); |
256 | 263 | }) |
257 | 264 | .catch((error) => { |
| 265 | + console.error(error); |
258 | 266 | $("main .preloader .icon").html( |
259 | 267 | `<i class="fas fa-fw fa-times"></i>` |
260 | 268 | ); |
261 | | - $("main .preloader .text").text(error.message); |
| 269 | + $("main .preloader .text").text( |
| 270 | + `Fatal error: ${error.message}. If this issue persists, please report it.` |
| 271 | + ); |
262 | 272 | // Error occurred during confirmation. The code might have expired or the |
263 | 273 | // password is too weak. |
264 | 274 | }); |
265 | 275 | }) |
266 | 276 | .catch((error) => { |
| 277 | + console.error(error); |
267 | 278 | $("main .preloader .icon").html(`<i class="fas fa-fw fa-times"></i>`); |
268 | | - $("main .preloader .text").text(error.message); |
| 279 | + $("main .preloader .text").text( |
| 280 | + `Fatal error: ${error.message}. If this issue persists, please report it.` |
| 281 | + ); |
| 282 | + |
269 | 283 | // $("main .preloader .subText").text(error); |
270 | 284 |
|
271 | 285 | // Invalid or expired action code. Ask user to try to reset the password |
|
308 | 322 | // in case the account was compromised: |
309 | 323 | }) |
310 | 324 | .catch((error) => { |
| 325 | + console.error(error); |
311 | 326 | $("main .preloader .icon").html(`<i class="fas fa-fw fa-times"></i>`); |
312 | 327 | $("main .preloader .text").text(error.message); |
313 | 328 | }); |
|
321 | 336 | $("main .preloader .subText").text(`Please check your inbox`); |
322 | 337 | }) |
323 | 338 | .catch((error) => { |
| 339 | + console.error(error); |
324 | 340 | $("main .preloader .icon").html(`<i class="fas fa-fw fa-times"></i>`); |
325 | 341 | $("main .preloader .text").text(error.message); |
326 | 342 | }); |
|
0 commit comments