Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | import { reactive, computed } from 'vue'; import { addCSRFHeader, clearCSRFToken } from '../utils/csrf'; import { getTraceHeaders } from '../utils/traceContext'; import { getApiBaseUrl } from '../config/api'; import { supabase, getOAuthRedirectUrl } from '../config/supabase'; import { recordLogin, recordLoginDuration, recordSignup, recordLogout, recordSessionRefresh, recordHttpRequest, setFaroUser, clearFaroUser, } from '../faro'; // Supabase client imported for OAuth only - regular API calls go through backend // Auth store const state = reactive({ user: null, session: null, profile: null, loading: false, error: null, }); export const useAuthStore = () => { // Computed properties const isAuthenticated = computed(() => !!state.session); const isAdmin = computed(() => state.profile?.role === 'admin'); const isClubManager = computed(() => state.profile?.role === 'club_manager'); const isClubFan = computed(() => state.profile?.role === 'club_fan'); const hasClubAccess = computed(() => !!state.profile?.club_id); const isTeamManager = computed( () => state.profile?.role === 'team-manager' || state.profile?.role === 'team_manager' ); const isPlayer = computed(() => state.profile?.role === 'team-player'); // Players can browse all leagues/divisions but not edit const canBrowseAll = computed(() => isAdmin.value || isPlayer.value); const canManageTeam = computed( () => isAdmin.value || isClubManager.value || isTeamManager.value ); const canManageClub = computed(() => isAdmin.value || isClubManager.value); const userRole = computed(() => state.profile?.role || 'team-fan'); const userTeamId = computed(() => state.profile?.team_id); const userClubId = computed(() => state.profile?.club_id); // Actions const setLoading = loading => { state.loading = loading; }; const setError = error => { state.error = error; }; const clearError = () => { state.error = null; }; const setUser = user => { state.user = user; }; const setSession = session => { state.session = session; if (session?.access_token) { localStorage.setItem('auth_token', session.access_token); if (session.refresh_token) { localStorage.setItem('refresh_token', session.refresh_token); } } else { localStorage.removeItem('auth_token'); localStorage.removeItem('refresh_token'); } }; const setProfile = profile => { if (profile) { // If profile.team is null but current_teams has entries (from player_team_history), // populate profile.team from the first current team so all components that check // profile.team work for players added via roster manager. if (!profile.team && profile.current_teams?.length > 0) { profile.team = profile.current_teams[0].team; } // Derive club_id from current_teams for roster-managed players // whose user_profiles.club_id was never set if (!profile.club_id && profile.current_teams?.length > 0) { const club = profile.current_teams[0].team?.club; if (club?.id) { profile.club_id = club.id; } } localStorage.setItem('auth_profile', JSON.stringify(profile)); } else { localStorage.removeItem('auth_profile'); } state.profile = profile; }; const signup = async (username, password, displayName, email = null) => { try { setLoading(true); clearError(); const response = await fetch(`${getApiBaseUrl()}/api/auth/signup`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...getTraceHeaders(), }, body: JSON.stringify({ username, password, display_name: displayName || username, email, // Optional email for notifications }), }); if (!response.ok) { const errorData = await response.json(); recordSignup(false, 'signup', { error_type: 'signup_failed' }); throw new Error(errorData.detail || 'Signup failed'); } const data = await response.json(); recordSignup(true, 'signup'); return { success: true, message: data.message || 'Signup successful!' }; } catch (error) { setError(error.message); recordSignup(false, 'signup', { error_type: 'exception' }); return { success: false, error: error.message }; } finally { setLoading(false); } }; const signupWithInvite = async ( username, password, displayName, inviteCode, email = null ) => { try { setLoading(true); clearError(); const response = await fetch(`${getApiBaseUrl()}/api/auth/signup`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...getTraceHeaders(), }, body: JSON.stringify({ username, password, display_name: displayName || username, invite_code: inviteCode, email, // Optional email for notifications }), }); if (!response.ok) { const errorData = await response.json(); recordSignup(false, 'signup_with_invite', { error_type: 'signup_failed', }); throw new Error(errorData.detail || 'Signup failed'); } const data = await response.json(); recordSignup(true, 'signup_with_invite'); return { success: true, message: data.message || 'Signup successful!' }; } catch (error) { setError(error.message); recordSignup(false, 'signup_with_invite', { error_type: 'exception' }); return { success: false, error: error.message }; } finally { setLoading(false); } }; const login = async (username, password) => { const startTime = performance.now(); try { setLoading(true); clearError(); const response = await fetch(`${getApiBaseUrl()}/api/auth/login`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...getTraceHeaders(), }, body: JSON.stringify({ username, password }), }); const duration = performance.now() - startTime; if (!response.ok) { const errorData = await response.json(); recordLogin(false, { error_type: 'invalid_credentials' }); recordLoginDuration(duration, false); throw new Error(errorData.detail || 'Login failed'); } const data = await response.json(); setUser(data.user); setSession({ access_token: data.access_token, refresh_token: data.refresh_token, }); // Login endpoint returns basic user info setProfile(data.user); // Store tokens for API calls localStorage.setItem('auth_token', data.access_token); localStorage.setItem('refresh_token', data.refresh_token); console.log('Login successful - Basic profile set:', data.user); // Fetch complete profile (includes photos, personal info, etc.) await fetchProfile(); console.log('Complete profile fetched:', state.profile); // Record successful login metrics and set user context for observability recordLogin(true, { user_role: data.user.role || 'team-fan' }); recordLoginDuration(duration, true); setFaroUser(data.user.id, { role: data.user.role || 'team-fan' }); return { success: true, user: data.user }; } catch (error) { const duration = performance.now() - startTime; setError(error.message); recordLogin(false, { error_type: 'exception' }); recordLoginDuration(duration, false); return { success: false, error: error.message }; } finally { setLoading(false); } }; // OAuth Social Login with Google (requires invite code for signup) const signInWithGoogle = async (inviteCode = null, displayName = null) => { try { setLoading(true); clearError(); const redirectTo = getOAuthRedirectUrl(); console.log('Starting Google OAuth, redirect URL:', redirectTo); // Store invite code and display name in localStorage to retrieve after OAuth callback // (OAuth state parameter is limited and can be unreliable across redirects) // For LOGIN flow (no invite code), we store a marker to indicate this is a login attempt if (inviteCode) { localStorage.setItem('oauth_invite_code', inviteCode); localStorage.setItem('oauth_flow_type', 'signup'); } else { localStorage.removeItem('oauth_invite_code'); localStorage.setItem('oauth_flow_type', 'login'); } if (displayName) { localStorage.setItem('oauth_display_name', displayName); } const { data, error } = await supabase.auth.signInWithOAuth({ provider: 'google', options: { redirectTo, queryParams: { access_type: 'offline', prompt: 'consent', }, }, }); if (error) { localStorage.removeItem('oauth_invite_code'); localStorage.removeItem('oauth_display_name'); recordLogin(false, { error_type: 'oauth_initiation_failed' }); throw new Error(error.message); } // User will be redirected to Google, then back to our callback URL // The callback handler will complete the authentication return { success: true, url: data.url }; } catch (error) { setError(error.message); recordLogin(false, { error_type: 'oauth_exception' }); return { success: false, error: error.message }; } finally { setLoading(false); } }; // Handle OAuth callback - called after redirect back from Google const handleOAuthCallback = async () => { try { setLoading(true); clearError(); // Retrieve invite code, flow type, and display name stored before OAuth redirect const inviteCode = localStorage.getItem('oauth_invite_code'); const flowType = localStorage.getItem('oauth_flow_type') || 'signup'; const customDisplayName = localStorage.getItem('oauth_display_name'); // Clean up immediately localStorage.removeItem('oauth_invite_code'); localStorage.removeItem('oauth_flow_type'); localStorage.removeItem('oauth_display_name'); const isLoginFlow = flowType === 'login' || !inviteCode; // Get the session from the URL hash (Supabase puts tokens there) const { data, error } = await supabase.auth.getSession(); if (error) { throw new Error(error.message); } if (!data.session) { throw new Error('No session found after OAuth callback'); } // DO NOT set session yet - wait for backend validation // The backend will verify the invite code (signup) or find existing user (login) // Verify with our backend and get/create user profile // For LOGIN: invite_code will be null, backend finds existing user // For SIGNUP: invite_code validates invite and creates profile const requestBody = { access_token: data.session.access_token, refresh_token: data.session.refresh_token, provider: 'google', }; // Only include invite_code and display_name for signup flow if (!isLoginFlow && inviteCode) { requestBody.invite_code = inviteCode; requestBody.display_name = customDisplayName; } console.log( `OAuth callback: ${isLoginFlow ? 'LOGIN' : 'SIGNUP'} flow`, isLoginFlow ? '' : `invite_code: ${inviteCode}` ); const response = await fetch( `${getApiBaseUrl()}/api/auth/oauth/callback`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${data.session.access_token}`, ...getTraceHeaders(), }, body: JSON.stringify(requestBody), } ); if (!response.ok) { const errorData = await response.json(); // Backend rejected - sign out of Supabase to clean up // This removes the Supabase user created during OAuth try { await supabase.auth.signOut(); } catch (signOutError) { console.warn( 'Failed to sign out of Supabase after rejection:', signOutError ); } throw new Error(errorData.detail || 'OAuth callback failed'); } const userData = await response.json(); // Only NOW set the session - after backend validation succeeded setSession({ access_token: data.session.access_token, refresh_token: data.session.refresh_token, }); setUser(userData.user); setProfile(userData.user); // Record successful OAuth login recordLogin(true, { user_role: userData.user.role || 'team-fan', provider: 'google', }); setFaroUser(userData.user.id, { role: userData.user.role || 'team-fan' }); return { success: true, user: userData.user }; } catch (error) { setError(error.message); recordLogin(false, { error_type: 'oauth_callback_failed' }); return { success: false, error: error.message }; } finally { setLoading(false); } }; const logout = async () => { try { setLoading(true); // Call backend logout endpoint using plain fetch (not apiCall to avoid infinite loop) const token = localStorage.getItem('auth_token'); if (token) { try { await fetch(`${getApiBaseUrl()}/api/auth/logout`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', }, }); } catch (e) { // Ignore logout endpoint errors - we'll clear local state anyway console.warn('Logout endpoint error (ignored):', e); } } // Clear local state regardless of API response setUser(null); setSession(null); setProfile(null); localStorage.removeItem('auth_token'); localStorage.removeItem('refresh_token'); localStorage.removeItem('sb-localhost-auth-token'); clearCSRFToken(); // Record logout metric and clear user context recordLogout(); clearFaroUser(); return { success: true }; } catch (error) { // Still clear local state on error setUser(null); setSession(null); setProfile(null); localStorage.clear(); setError(error.message); return { success: false, error: error.message }; } finally { setLoading(false); } }; const forceLogout = () => { // Force clear all auth state without async calls state.user = null; state.session = null; state.profile = null; state.loading = false; state.error = null; localStorage.clear(); sessionStorage.clear(); }; const fetchProfile = async () => { try { if (!state.session) return; const response = await apiCall(`${getApiBaseUrl()}/api/auth/me`); if (response && response.success) { setProfile(response.user.profile); return response.user.profile; } else { console.warn('No profile found for user'); return null; } } catch (error) { console.error('Error fetching profile:', error); setError(error.message); } }; const updateProfile = async updates => { try { setLoading(true); clearError(); const response = await apiCall(`${getApiBaseUrl()}/api/auth/profile`, { method: 'PUT', body: JSON.stringify({ ...updates, updated_at: new Date().toISOString(), }), }); if (response && response.success) { // Refresh profile await fetchProfile(); return { success: true, data: response.data }; } else { throw new Error(response?.detail || 'Profile update failed'); } } catch (error) { setError(error.message); return { success: false, error: error.message }; } finally { setLoading(false); } }; const initialize = async () => { try { setLoading(true); // Check for existing token const token = localStorage.getItem('auth_token'); if (!token) { return; } // Don't set session until verification succeeds // This prevents showing authenticated content while verifying // Get current user info from backend (verify token) const response = await fetch(`${getApiBaseUrl()}/api/auth/me`, { headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', ...getTraceHeaders(), }, }); if (response.ok) { const data = await response.json(); if (data && data.success) { setUser(data.user); // /api/auth/me returns role/team_id nested in user.profile const profileData = data.user.profile || data.user; setProfile(profileData); setSession({ access_token: token }); // Only set session after verification console.log('Initialize - Profile loaded:', profileData); } else { // Invalid response, clear storage localStorage.clear(); } } else if (response.status === 401) { // Token expired, try to refresh const refreshToken = localStorage.getItem('refresh_token'); if (refreshToken) { const refreshResult = await refreshSession(); if (refreshResult.success) { // Retry initialization with new token const newToken = localStorage.getItem('auth_token'); const retryResponse = await fetch( `${getApiBaseUrl()}/api/auth/me`, { headers: { Authorization: `Bearer ${newToken}`, 'Content-Type': 'application/json', ...getTraceHeaders(), }, } ); if (retryResponse.ok) { const retryData = await retryResponse.json(); if (retryData && retryData.success) { setUser(retryData.user); const profileData = retryData.user.profile || retryData.user; setProfile(profileData); setSession({ access_token: newToken }); console.log( 'Initialize - Profile loaded after refresh:', profileData ); return; } } } } // Refresh failed or no refresh token, clear storage localStorage.clear(); } else { // Other error, clear storage localStorage.clear(); } } catch (error) { console.error('Auth initialization error:', error); localStorage.clear(); } finally { setLoading(false); } }; // API helpers with auth headers const getAuthHeaders = () => { const token = localStorage.getItem('auth_token'); return { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', ...getTraceHeaders(), // Include session_id and request_id for distributed tracing }; }; // NEW: Simple API call helper with auth headers const apiCall = async (endpoint, options = {}) => { const startTime = performance.now(); const method = options.method || 'GET'; const token = localStorage.getItem('auth_token'); const traceHeaders = getTraceHeaders(); // Generate trace IDs for this request const defaultHeaders = { ...traceHeaders }; // Only set Content-Type for non-FormData requests // FormData needs the browser to set Content-Type with boundary automatically if (!(options.body instanceof FormData)) { defaultHeaders['Content-Type'] = 'application/json'; } if (token) { defaultHeaders.Authorization = `Bearer ${token}`; } const response = await fetch(endpoint, { ...options, cache: 'no-store', headers: { ...defaultHeaders, ...options.headers, }, }); const duration = performance.now() - startTime; if (response.status === 401) { // Token expired, try refresh const refreshResult = await refreshSession(); if (refreshResult.success) { // Retry original request const retryToken = localStorage.getItem('auth_token'); if (retryToken) { defaultHeaders.Authorization = `Bearer ${retryToken}`; const retryResponse = await fetch(endpoint, { ...options, cache: 'no-store', headers: { ...defaultHeaders, ...options.headers, }, }); const retryDuration = performance.now() - startTime; if (retryResponse.ok) { recordHttpRequest( endpoint, method, retryResponse.status, retryDuration ); if ( retryResponse.status === 204 || retryResponse.headers.get('content-length') === '0' ) { return null; } return retryResponse.json(); } recordHttpRequest( endpoint, method, retryResponse.status, retryDuration ); } } // Refresh failed or retry failed, force logout recordHttpRequest(endpoint, method, 401, duration); await logout(); throw new Error('Session expired. Please log in again.'); } // Record HTTP request metrics recordHttpRequest(endpoint, method, response.status, duration); if (!response.ok) { const error = await response .json() .catch(() => ({ message: 'Network error' })); // Handle FastAPI validation errors (422) where detail is an array let errorMessage = 'Request failed'; if (Array.isArray(error.detail)) { // Extract message(s) from validation error array errorMessage = error.detail .map(e => e.msg || e.message || JSON.stringify(e)) .join('; '); } else if (typeof error.detail === 'string') { errorMessage = error.detail; } else if (error.message) { errorMessage = error.message; } throw new Error(errorMessage); } if ( response.status === 204 || response.headers.get('content-length') === '0' ) { return null; } return response.json(); }; const isTokenExpiringSoon = () => { if (!state.session?.expires_at) return false; const expiresAt = new Date(state.session.expires_at * 1000); const now = new Date(); const timeUntilExpiry = expiresAt.getTime() - now.getTime(); // Return true if token expires in less than 5 minutes return timeUntilExpiry < 5 * 60 * 1000; }; const refreshSession = async () => { try { const refreshToken = localStorage.getItem('refresh_token'); if (!refreshToken) { recordSessionRefresh(false); throw new Error('No refresh token'); } const response = await fetch(`${getApiBaseUrl()}/api/auth/refresh`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...getTraceHeaders(), }, body: JSON.stringify({ refresh_token: refreshToken }), }); if (!response.ok) { recordSessionRefresh(false); throw new Error('Token refresh failed'); } const data = await response.json(); setSession(data.session); recordSessionRefresh(true); return { success: true }; } catch (error) { // Refresh failed, force logout setUser(null); setSession(null); setProfile(null); localStorage.clear(); recordSessionRefresh(false); return { success: false, error: error.message }; } }; const apiRequest = async (url, options = {}) => { // For FormData, don't set Content-Type - browser sets it with boundary const isFormData = options.body instanceof FormData; const token = localStorage.getItem('auth_token'); let headers = { Authorization: `Bearer ${token}`, ...getTraceHeaders(), // Include trace IDs for distributed tracing ...options.headers, }; // Only add Content-Type for non-FormData requests if (!isFormData) { headers['Content-Type'] = 'application/json'; } if ( ['POST', 'PUT', 'DELETE', 'PATCH'].includes(options.method?.toUpperCase()) ) { headers = await addCSRFHeader(headers); } // Use the simpler apiCall helper return apiCall(url, { ...options, headers }); }; const requestPasswordReset = async (identifier, email = null) => { try { setLoading(true); clearError(); const body = { identifier }; if (email) body.email = email; const response = await fetch( `${getApiBaseUrl()}/api/auth/forgot-password`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...getTraceHeaders(), }, body: JSON.stringify(body), } ); const data = await response.json(); if (!response.ok) { throw new Error(data.detail || 'Request failed'); } return { success: true, needsEmail: !!data.needs_email, message: data.message, }; } catch (error) { setError(error.message); return { success: false, error: error.message }; } finally { setLoading(false); } }; const resetPassword = async (token, newPassword) => { try { setLoading(true); clearError(); const response = await fetch( `${getApiBaseUrl()}/api/auth/reset-password`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...getTraceHeaders(), }, body: JSON.stringify({ token, new_password: newPassword }), } ); const data = await response.json(); if (!response.ok) { throw new Error(data.detail || 'Password reset failed'); } return { success: true, message: data.message }; } catch (error) { setError(error.message); return { success: false, error: error.message }; } finally { setLoading(false); } }; const checkUsernameAvailability = async username => { try { const response = await fetch( `${getApiBaseUrl()}/api/auth/username-available/${username}`, { method: 'GET', headers: { 'Content-Type': 'application/json', ...getTraceHeaders(), }, } ); if (!response.ok) { throw new Error('Failed to check username availability'); } const data = await response.json(); return data; // Returns { available, message, suggestions? } } catch (error) { console.error('Username availability check error:', error); return { available: false, message: 'Error checking username' }; } }; return { // State state, // Computed isAuthenticated, isAdmin, isClubManager, isClubFan, hasClubAccess, isTeamManager, isPlayer, canBrowseAll, canManageTeam, canManageClub, userRole, userTeamId, userClubId, // Actions signup, signupWithInvite, login, signInWithGoogle, handleOAuthCallback, logout, forceLogout, fetchProfile, updateProfile, initialize, setError, clearError, // Helpers getAuthHeaders, apiRequest, apiCall, refreshSession, isTokenExpiringSoon, checkUsernameAvailability, requestPasswordReset, resetPassword, }; }; |