Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
red-giant
dashboard
Commits
a59bd356
Verified
Commit
a59bd356
authored
3 years ago
by
Defendi Alberto
Browse files
Options
Downloads
Patches
Plain Diff
Corrected mount action which was causing infinite loop.
parent
e8f5de30
No related branches found
No related tags found
2 merge requests
!56
Refined auth flow and new website pages.
,
!45
Polished auth flow including ReservedRoute and role selection.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/App.tsx
+1
-1
1 addition, 1 deletion
src/App.tsx
src/components/AuthUser/SignInForm/SignInForm.tsx
+2
-1
2 additions, 1 deletion
src/components/AuthUser/SignInForm/SignInForm.tsx
with
3 additions
and
2 deletions
src/App.tsx
+
1
−
1
View file @
a59bd356
...
@@ -31,7 +31,7 @@ export const App: FC = () => {
...
@@ -31,7 +31,7 @@ export const App: FC = () => {
// Initialize asking the server if this session is already logged in.
// Initialize asking the server if this session is already logged in.
isAuthenticated
().
then
((
responseState
)
=>
setIsAuth
(
responseState
));
isAuthenticated
().
then
((
responseState
)
=>
setIsAuth
(
responseState
));
getRole
().
then
((
responseRole
)
=>
setRole
(
responseRole
));
getRole
().
then
((
responseRole
)
=>
setRole
(
responseRole
));
},
[
isAuth
,
role
]);
},
[]);
return
(
return
(
<
div
data-testid
=
"App"
>
<
div
data-testid
=
"App"
>
...
...
This diff is collapsed.
Click to expand it.
src/components/AuthUser/SignInForm/SignInForm.tsx
+
2
−
1
View file @
a59bd356
...
@@ -28,7 +28,7 @@ export const SignInForm: FC = () => {
...
@@ -28,7 +28,7 @@ export const SignInForm: FC = () => {
return
()
=>
{
return
()
=>
{
isMounted
=
false
;
isMounted
=
false
;
};
};
},
[
cookie
]);
},
[]);
const
{
control
,
errors
,
setError
,
handleSubmit
}
=
useForm
<
CredentialsType
>
({
const
{
control
,
errors
,
setError
,
handleSubmit
}
=
useForm
<
CredentialsType
>
({
defaultValues
,
defaultValues
,
...
@@ -52,6 +52,7 @@ export const SignInForm: FC = () => {
...
@@ -52,6 +52,7 @@ export const SignInForm: FC = () => {
},
},
)
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
console
.
log
(
response
);
if
(
response
.
data
.
status
===
'
fail
'
)
{
if
(
response
.
data
.
status
===
'
fail
'
)
{
setError
(
'
username
'
,
{
setError
(
'
username
'
,
{
type
:
'
server
'
,
type
:
'
server
'
,
...
...
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