mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 13:29:22 +00:00
Can get security settings
This commit is contained in:
parent
02ee59817a
commit
3811a26024
@ -91,6 +91,8 @@ export const Routes : Route[] = [
|
|||||||
|
|
||||||
{path: "/settings/set_language", cb: (h) => SettingsController.SetLanguage(h)},
|
{path: "/settings/set_language", cb: (h) => SettingsController.SetLanguage(h)},
|
||||||
|
|
||||||
|
{path: "/settings/get_security", cb: (h) => SettingsController.GetSecurity(h)},
|
||||||
|
|
||||||
|
|
||||||
// Friends controller
|
// Friends controller
|
||||||
{path: "/friends/getList", cb: (h) => FriendsController.GetList(h)},
|
{path: "/friends/getList", cb: (h) => FriendsController.GetList(h)},
|
||||||
|
@ -135,4 +135,23 @@ export class SettingsController {
|
|||||||
|
|
||||||
h.success();
|
h.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get security settings
|
||||||
|
*
|
||||||
|
* @param h Request handler
|
||||||
|
*/
|
||||||
|
public static async GetSecurity(h: RequestHandler) {
|
||||||
|
await h.needUserPostPassword("password");
|
||||||
|
|
||||||
|
const userInfo = await UserHelper.GetUserInfo(h.getUserId());
|
||||||
|
|
||||||
|
h.send({
|
||||||
|
id: userInfo.id,
|
||||||
|
security_question_1: userInfo.hasSecurityQuestion1 ? userInfo.security_question_1 : "",
|
||||||
|
security_answer_1: userInfo.hasSecurityAnswer1 ? userInfo.security_answer_1 : "",
|
||||||
|
security_question_2: userInfo.hasSecurityQuestion2 ? userInfo.security_question_2 : "",
|
||||||
|
security_answer_2: userInfo.hasSecurityAnswer2 ? userInfo.security_answer_2 : "",
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user