Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fahrtenbuch
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
SWP WS21_22 - Fahrtenbuch
Team Einhorn
fahrtenbuch
Commits
17279800
Commit
17279800
authored
3 years ago
by
Leander Tolksdorf
Browse files
Options
Downloads
Patches
Plain Diff
rename /api/login body parameter "username" to "email"
parent
39f675a3
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
server/src/controllers/auth.controllers.ts
+2
-2
2 additions, 2 deletions
server/src/controllers/auth.controllers.ts
server/src/routes/auth.routes.ts
+1
-1
1 addition, 1 deletion
server/src/routes/auth.routes.ts
with
3 additions
and
3 deletions
server/src/controllers/auth.controllers.ts
+
2
−
2
View file @
17279800
...
...
@@ -7,12 +7,12 @@ import envVars from "../config";
//log in
const
authLoginController
=
async
(
req
:
Request
,
res
:
Response
)
=>
{
try
{
const
{
username
,
password
}
=
req
.
body
;
const
{
username
:
email
,
password
}
=
req
.
body
;
const
employee
=
await
Employee
.
findOne
({
attributes
:
[
"
email
"
,
"
password
"
,
"
role
"
],
where
:
{
email
:
username
,
email
:
email
,
},
});
...
...
This diff is collapsed.
Click to expand it.
server/src/routes/auth.routes.ts
+
1
−
1
View file @
17279800
...
...
@@ -8,7 +8,7 @@ const authRouter = Router();
//log in route
authRouter
.
post
(
"
/api/login/
"
,
body
(
"
username
"
).
isEmail
().
normalizeEmail
(),
body
(
"
email
"
).
isEmail
().
normalizeEmail
(),
body
(
"
password
"
).
not
().
isEmpty
(),
handleValidationResult
,
authControllers
.
authLoginController
...
...
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