Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tma-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Denys Tito Urbano
tma-backend
Commits
e5b4691f
Commit
e5b4691f
authored
Aug 31, 2022
by
Denys Tito Urbano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Router auth modificado (Login solo con email)
parent
0c7f0619
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
auth.db.js
db/auth.db.js
+5
-1
auth.router.js
routes/auth.router.js
+1
-1
No files found.
db/auth.db.js
View file @
e5b4691f
const
connection
=
require
(
'./config'
);
const
connection
=
require
(
'./config'
);
const
post_login
=
async
({
email
,
password
})
=>
{
const
post_login
=
async
({
email
,
password
})
=>
{
return
await
connection
.
oneOrNone
(
'SELECT * FROM academico.func_tma_login ( $1, $2 );'
,
[
email
,
password
]);
if
(
password
)
{
return
await
connection
.
oneOrNone
(
'SELECT * FROM academico.func_tma_login ( $1, $2 );'
,
[
email
,
password
]);
}
else
{
return
await
connection
.
oneOrNone
(
'SELECT * FROM academico.func_tma_login ( $1 );'
,
[
email
]);
}
};
};
const
get_account
=
async
({
documento
})
=>
{
const
get_account
=
async
({
documento
})
=>
{
...
...
routes/auth.router.js
View file @
e5b4691f
...
@@ -6,7 +6,7 @@ const { validate_errors, validate_jwt } = require('../middlewares');
...
@@ -6,7 +6,7 @@ const { validate_errors, validate_jwt } = require('../middlewares');
router
.
post
(
'/login'
,
router
.
post
(
'/login'
,
check
(
'email'
,
'Usuario inválido'
).
not
().
isEmpty
(),
check
(
'email'
,
'Usuario inválido'
).
not
().
isEmpty
(),
check
(
'password'
,
'Contraseña inválida'
).
not
().
isEmpty
(),
//
check('password', 'Contraseña inválida').not().isEmpty(),
validate_errors
,
validate_errors
,
post_login
);
post_login
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment