Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
COM3014
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
Abdelsamad, Mouaz R (UG - SISC)
COM3014
Commits
3c84b1bb
Commit
3c84b1bb
authored
11 months ago
by
lcross2002
Browse files
Options
Downloads
Patches
Plain Diff
Dashboard login register bugfix
parent
a58e32f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/src/components/Login/Login.tsx
+2
-2
2 additions, 2 deletions
client/src/components/Login/Login.tsx
client/src/components/Register/Register.tsx
+1
-1
1 addition, 1 deletion
client/src/components/Register/Register.tsx
with
3 additions
and
3 deletions
client/src/components/Login/Login.tsx
+
2
−
2
View file @
3c84b1bb
...
@@ -13,7 +13,7 @@ export interface ILoginForm {
...
@@ -13,7 +13,7 @@ export interface ILoginForm {
}
}
export
function
Login
()
{
export
function
Login
()
{
const
{
giveAuth
,
updateUser
,
user
}
=
useAuth
();
const
{
giveAuth
,
updateUser
}
=
useAuth
();
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
[
error
,
setError
]
=
useState
(
''
);
const
[
error
,
setError
]
=
useState
(
''
);
const
{
register
,
handleSubmit
}
=
useForm
<
ILoginForm
>
({
mode
:
'
onChange
'
});
const
{
register
,
handleSubmit
}
=
useForm
<
ILoginForm
>
({
mode
:
'
onChange
'
});
...
@@ -25,7 +25,7 @@ export function Login() {
...
@@ -25,7 +25,7 @@ export function Login() {
const
result
=
await
loginUser
(
formValue
);
const
result
=
await
loginUser
(
formValue
);
giveAuth
();
giveAuth
();
updateUser
(
result
.
data
);
updateUser
(
result
.
data
);
navigate
(
`/
${
userToDashboard
(
user
)}
`
);
navigate
(
`/
${
userToDashboard
(
result
.
data
)}
`
);
}
catch
(
error
)
{
}
catch
(
error
)
{
const
errorMessage
=
(
error
as
AxiosError
).
response
?.
data
;
const
errorMessage
=
(
error
as
AxiosError
).
response
?.
data
;
...
...
This diff is collapsed.
Click to expand it.
client/src/components/Register/Register.tsx
+
1
−
1
View file @
3c84b1bb
...
@@ -38,7 +38,7 @@ export function Register() {
...
@@ -38,7 +38,7 @@ export function Register() {
const
result
=
await
registerUser
(
formValue
);
const
result
=
await
registerUser
(
formValue
);
giveAuth
();
giveAuth
();
updateUser
(
result
.
data
);
updateUser
(
result
.
data
);
navigate
(
`/
${
userToDashboard
(
user
)}
`
);
navigate
(
`/
${
userToDashboard
(
result
.
data
)}
`
);
}
catch
(
error
)
{
}
catch
(
error
)
{
const
errorMessage
=
(
error
as
AxiosError
).
response
?.
data
;
const
errorMessage
=
(
error
as
AxiosError
).
response
?.
data
;
...
...
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