Skip to content

Commit

Permalink
Fix for hasOwn
Browse files Browse the repository at this point in the history
- Also add null check on function call
- Closes #8595
  • Loading branch information
SchrodingersGat committed Nov 30, 2024
1 parent 3149ae7 commit d33e2db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/frontend/src/functions/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ function post(path: string, params: any, method = 'post') {
form.action = path;

for (const key in params) {
if (params.hasOwn(key)) {
if (
params.hasOwn?.(key) ||
Object.prototype.hasOwnProperty.call(params, key)
) {
const hiddenField = document.createElement('input');
hiddenField.type = 'hidden';
hiddenField.name = key;
Expand Down

0 comments on commit d33e2db

Please sign in to comment.