Skip to content

Commit

Permalink
ugh api
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Jan 9, 2024
1 parent 9df3b34 commit b41d0b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async function ensureAuthenticated(req, res, next) {
if (!req.user) { return res.redirect('/login'); }
req.user._json.groups = await getUserGroups(req.user.oid, gat);
const intserect = validateArray(config.groups_permitted, req.user._json.groups);
if (!intserect && !intersect2) {
if (!intserect) {
return res.status(401).redirect("/unauthorized");
}
next();
Expand Down Expand Up @@ -246,8 +246,7 @@ app.post('/paylink', ensureAuthenticated, async function (req, res) {
})
const { body } = req;
const {error} = schema.validate(body);
const valid = error === null;
if (!valid) {
if (error) {
return res.status(422).json({
success: false,
message: error.details[0].message
Expand Down
1 change: 1 addition & 0 deletions public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ async function submitData() {
}
bodyconst[item] = it
}
bodyconst['amnt'] = parseFloat(bodyconst['amnt'])
const response = await fetch(`/paylink`, {
method: "POST",
headers: {
Expand Down

0 comments on commit b41d0b4

Please sign in to comment.