MCPcopy
hub / github.com/FlowiseAI/Flowise / ResetPasswordPage

Function ResetPasswordPage

packages/ui/src/views/auth/resetPassword.jsx:30–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28// ==============================|| ResetPasswordPage ||============================== //
29
30const ResetPasswordPage = () => {
31 const theme = useTheme()
32 useNotifier()
33 const navigate = useNavigate()
34 const dispatch = useDispatch()
35 const enqueueSnackbar = (...args) => dispatch(enqueueSnackbarAction(...args))
36 const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args))
37
38 const emailInput = {
39 label: 'Email',
40 name: 'email',
41 type: 'email',
42 placeholder: 'user@company.com'
43 }
44
45 const passwordInput = {
46 label: 'Password',
47 name: 'password',
48 type: 'password',
49 placeholder: '********'
50 }
51
52 const confirmPasswordInput = {
53 label: 'Confirm Password',
54 name: 'confirmPassword',
55 type: 'password',
56 placeholder: '********'
57 }
58
59 const resetPasswordInput = {
60 label: 'Reset Token',
61 name: 'resetToken',
62 type: 'text'
63 }
64
65 const [params] = useSearchParams()
66 const token = params.get('token')
67
68 const [emailVal, setEmailVal] = useState('')
69 const [newPasswordVal, setNewPasswordVal] = useState('')
70 const [confirmPasswordVal, setConfirmPasswordVal] = useState('')
71 const [tokenVal, setTokenVal] = useState(token ?? '')
72
73 const [loading, setLoading] = useState(false)
74 const [authErrors, setAuthErrors] = useState([])
75
76 const { authRateLimitError, setAuthRateLimitError } = useError()
77
78 const goLogin = () => {
79 navigate('/signin', { replace: true })
80 }
81
82 const validateAndSubmit = async (event) => {
83 event.preventDefault()
84 const validationErrors = []
85 setAuthErrors([])
86 setAuthRateLimitError(null)
87 if (!tokenVal) {

Callers

nothing calls this directly

Calls 3

useErrorFunction · 0.90
useNotifierFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected