Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RAGchat-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zbhAI
RAGchat-frontend
Commits
8ef14cbb
Commit
8ef14cbb
authored
9 months ago
by
Embruch, Gerd
Browse files
Options
Downloads
Patches
Plain Diff
fixed password reset
parent
2b2fcfc5
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/contexts/Auth/AuthState.jsx
+1
-6
1 addition, 6 deletions
src/contexts/Auth/AuthState.jsx
src/pages/User/ResetPassword.jsx
+6
-6
6 additions, 6 deletions
src/pages/User/ResetPassword.jsx
src/routes/Sitemap.jsx
+0
-16
0 additions, 16 deletions
src/routes/Sitemap.jsx
with
7 additions
and
28 deletions
src/contexts/Auth/AuthState.jsx
+
1
−
6
View file @
8ef14cbb
...
...
@@ -56,13 +56,9 @@ function AuthState({ children }) {
// ### REQUEST PASSWORD RESET
function
requestPasswordReset
(
email
)
{
return
api
.
post
(
'
/
users/request
passwordreset
'
,
{
email
});
return
api
.
post
(
'
/
auth/
password
-
reset
'
,
{
email
});
}
// ### REQUEST PASSWORD RESET
function
requestEmailReset
(
email
)
{
return
api
.
post
(
'
/users/requestemailchange
'
,
{
email
});
}
// ### RETURN
return
(
...
...
@@ -73,7 +69,6 @@ function AuthState({ children }) {
logout
,
requestVerificationToken
,
requestPasswordReset
,
requestEmailReset
,
USER_ACTIONS
,
dispatchCurrentUser
}
}
>
...
...
This diff is collapsed.
Click to expand it.
src/pages/User/ResetPassword.jsx
+
6
−
6
View file @
8ef14cbb
...
...
@@ -18,13 +18,14 @@ function ResetPasswordForm() {
// VALIDATION SCHEMA
// #################################
const
schema
=
z
.
object
({
token
:
z
.
string
().
min
(
1
),
password
:
z
.
string
().
refine
((
val
)
=>
val
&&
isStrongPassword
(
val
),
{
message
:
'
This field must be min 6 characters long and contain uppercase, lowercase, number, specialchar.
'
,
}),
passwordConfirm
:
z
.
string
(),
}).
refine
((
data
)
=>
data
.
password
===
data
.
passwordConfirm
,
{
confirmPassword
:
z
.
string
(),
}).
refine
((
data
)
=>
data
.
password
===
data
.
confirmPassword
,
{
message
:
"
Passwords don't match
"
,
path
:
[
"
passwordConfirm
"
],
path
:
[
"
confirmPassword
"
],
});
// #################################
...
...
@@ -54,11 +55,10 @@ function ResetPasswordForm() {
// ### HANDLE SUBMITTING FORM
async
function
handleSendForm
(
inputs
)
{
// TRY UPDATE
try
{
// send data
const
result
=
await
api
.
p
ost
(
`/users/confirm
passwordreset`
,
inputs
);
const
result
=
await
api
.
p
atch
(
`/auth/
password
-
reset`
,
inputs
);
await
logout
();
redirect
(
'
/login
'
);
// set flash message
...
...
@@ -83,7 +83,7 @@ function ResetPasswordForm() {
<
form
onSubmit
=
{
methods
.
handleSubmit
(
handleSendForm
)
}
>
<
Input
name
=
'token'
type
=
'text'
title
=
'confirm token'
className
=
'h-16'
/>
<
Input
name
=
'password'
type
=
'password'
title
=
'new password'
className
=
'h-16'
autoFocus
=
{
true
}
/>
<
Input
name
=
'
passwordConfirm
'
type
=
'password'
title
=
'confirm password'
className
=
'h-16'
/>
<
Input
name
=
'
confirmPassword
'
type
=
'password'
title
=
'confirm password'
className
=
'h-16'
/>
<
Submit
value
=
'Reset'
/>
</
form
>
...
...
This diff is collapsed.
Click to expand it.
src/routes/Sitemap.jsx
+
0
−
16
View file @
8ef14cbb
...
...
@@ -27,22 +27,6 @@ export const sitemap = [{
]
},
// REQUEST CHANGE EMAIL ADDRESS
{
title
:
'
Change eMail
'
,
path
:
'
/change_email
'
,
handle
:
{
crumb
:
()
=>
<
Link
to
=
"/change_email"
>
Change eMail
</
Link
>
},
children
:
[
{
index
:
true
,
element
:
loadComponent
(
'
User/RequestChangeMail
'
)
},
// CHANGE EMAIL ADDRESS
{
title
:
'
Change eMail
'
,
path
:
'
:token
'
,
hidden
:
true
,
element
:
loadComponent
(
'
User/ChangeMail
'
)
}
]
},
// LOGOUT
{
title
:
'
Logout
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment