fix bugs in paasldap backend and auth password endpoint
This commit is contained in:
parent
bb047a3782
commit
1ffe9fbe7c
@ -30,7 +30,7 @@ export default class PAASLDAP extends AUTH_BACKEND {
|
||||
};
|
||||
|
||||
if (auth) {
|
||||
content.headers.PAASLDAPAuthTicket = auth.PAASLDAPAuthTicket;
|
||||
content.headers.Cookie = `PAASLDAPAuthTicket=${auth.PAASLDAPAuthTicket};`;
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -104,18 +104,13 @@ router.delete("/ticket", async (req, res) => {
|
||||
/**
|
||||
* POST - change user password
|
||||
* request:
|
||||
* - binduser: string
|
||||
* - bindpass: string
|
||||
* - username: string
|
||||
* - password: string
|
||||
* responses:
|
||||
* - PAAS-LDAP API response
|
||||
*/
|
||||
router.post("/password", async (req, res) => {
|
||||
const params = {
|
||||
binduser: req.body.binduser,
|
||||
bindpass: req.body.bindpass,
|
||||
username: req.body.username,
|
||||
username: req.cookies.username,
|
||||
password: req.body.password
|
||||
};
|
||||
|
||||
@ -128,11 +123,7 @@ router.post("/password", async (req, res) => {
|
||||
const newAttributes = {
|
||||
userpassword: params.password
|
||||
};
|
||||
const bindParams = {
|
||||
binduser: params.binduser,
|
||||
bindpass: params.bindpass
|
||||
};
|
||||
const response = await handler.modUser(userID, newAttributes, bindParams);
|
||||
const response = await handler.modUser(userID, newAttributes, req.cookies);
|
||||
if (response.ok) {
|
||||
res.status(response.status).send();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user