mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-12-03 02:41:23 +01:00
2fa work slight refactor
- use existing access mechanisms for validation - adds swagger/schema and validation of incoming payload
This commit is contained in:
1 parent
b7dfaddbb1
commit
462c134751
14 files changed
+565
-418
No files matched your search
@@ -66,16 +66,7 @@ router
|
||||
*/
|
||||
.post(async (req, res, next) => {
|
||||
try {
|
||||
const { challenge_token, code } = req.body;
|
||||
|
||||
if (!challenge_token || !code) {
|
||||
return res.status(400).json({
|
||||
error: {
|
||||
message: "Missing challenge_token or code",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const { challenge_token, code } = await apiValidator(getValidationSchema("/tokens/2fa", "post"), req.body);
|
||||
const result = await internalToken.verify2FA(challenge_token, code);
|
||||
res.status(200).send(result);
|
||||
} catch (err) {
|
||||
|
||||
Reference in new issue
Block a user