Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
6938bcd1
Unverified
Commit
6938bcd1
authored
1 year ago
by
Hugo Costa
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: Manually approved user registration flow (#29420)
parent
3de66415
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.changeset/registration-flow.md
+8
-0
8 additions, 0 deletions
.changeset/registration-flow.md
packages/web-ui-registration/src/RegisterForm.tsx
+10
-1
10 additions, 1 deletion
packages/web-ui-registration/src/RegisterForm.tsx
with
18 additions
and
1 deletion
.changeset/registration-flow.md
0 → 100644
+
8
−
0
View file @
6938bcd1
---
"
@rocket.chat/web-ui-registration"
:
patch
---
fix: Manually approved user registration flow
The new user gets redirected to the login page with a toast message saying:
> Before you can login, your account must be manually activated by an administrator.
This diff is collapsed.
Click to expand it.
packages/web-ui-registration/src/RegisterForm.tsx
+
10
−
1
View file @
6938bcd1
import
{
useUniqueId
}
from
'
@rocket.chat/fuselage-hooks
'
;
import
{
FieldGroup
,
TextInput
,
Field
,
PasswordInput
,
ButtonGroup
,
Button
,
TextAreaInput
}
from
'
@rocket.chat/fuselage
'
;
import
{
Form
,
ActionLink
}
from
'
@rocket.chat/layout
'
;
import
{
useSetting
}
from
'
@rocket.chat/ui-contexts
'
;
import
{
useSetting
,
useToastMessageDispatch
}
from
'
@rocket.chat/ui-contexts
'
;
import
type
{
ReactElement
}
from
'
react
'
;
import
{
useForm
}
from
'
react-hook-form
'
;
import
{
Trans
,
useTranslation
}
from
'
react-i18next
'
;
...
...
@@ -33,6 +33,8 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo
const
formLabelId
=
useUniqueId
();
const
registerUser
=
useRegisterMethod
();
const
dispatchToastMessage
=
useToastMessageDispatch
();
const
{
register
,
handleSubmit
,
...
...
@@ -62,6 +64,13 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo
if
(
/Username is already in use/
.
test
(
error
.
error
))
{
setError
(
'
username
'
,
{
type
:
'
username-already-exists
'
,
message
:
t
(
'
registration.component.form.userAlreadyExist
'
)
});
}
if
(
/error-too-many-requests/
.
test
(
error
.
error
))
{
dispatchToastMessage
({
type
:
'
error
'
,
message
:
error
.
error
});
}
if
(
/error-user-is-not-activated/
.
test
(
error
.
error
))
{
dispatchToastMessage
({
type
:
'
info
'
,
message
:
t
(
'
registration.page.registration.waitActivationWarning
'
)
});
setLoginRoute
(
'
login
'
);
}
},
},
);
...
...
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