Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
63dcd534
Commit
63dcd534
authored
Sep 24, 2021
by
Wolfgang Knopki
Browse files
fixed double callbacks causing ERR_HTTP_HEADERS_SENT
parent
e00f0382
Changes
1
Hide whitespace changes
Inline
Side-by-side
functions/methods.ts
View file @
63dcd534
...
...
@@ -60,7 +60,6 @@ var methods = {
})
});
});
callback
(
err
)
});
callback
(
err
)
})
...
...
@@ -165,27 +164,29 @@ var methods = {
return
null
},
verifyUserAccount
:
function
(
userData
:
any
,
callback
:
any
)
{
dbconn
.
user
.
beginTransaction
(
function
(
err
:
any
)
{
// START TRANSACTION
if
(
err
)
{
throw
err
}
// update user status
dbconn
.
user
.
query
(
'
UPDATE user SET ? WHERE id =
'
+
userData
.
id
,
userData
,
function
(
err
:
any
,
rows
:
any
,
fields
:
any
)
{
if
(
err
)
{
return
dbconn
.
user
.
rollback
(
function
()
{
throw
err
})
}
// delete verification token
dbconn
.
user
.
query
(
'
DELETE FROM verification WHERE user_id =
'
+
userData
.
id
,
function
(
err
:
any
,
rows
:
any
,
fields
:
any
)
{
dbconn
.
user
.
getConnection
(
function
(
err
:
any
,
thisconn
){
thisconn
.
beginTransaction
(
function
(
err
:
any
)
{
// START TRANSACTION
if
(
err
)
{
throw
err
}
// update user status
thisconn
.
query
(
'
UPDATE user SET ? WHERE id =
'
+
userData
.
id
,
userData
,
function
(
err
:
any
,
rows
:
any
,
fields
:
any
)
{
if
(
err
)
{
return
dbconn
.
user
.
rollback
(
function
()
{
throw
err
})
return
thisconn
.
rollback
(
function
()
{
throw
err
})
}
//
COMMIT
db
conn
.
user
.
commit
(
function
(
err
:
any
)
{
//
delete verification token
this
conn
.
query
(
'
DELETE FROM verification WHERE user_id =
'
+
userData
.
id
,
function
(
err
:
any
,
rows
:
any
,
fields
:
any
)
{
if
(
err
)
{
return
dbconn
.
user
.
rollback
(
function
()
{
throw
err
})
return
thisconn
.
rollback
(
function
()
{
throw
err
})
}
// COMMIT
thisconn
.
commit
(
function
(
err
:
any
)
{
if
(
err
)
{
return
thisconn
.
rollback
(
function
()
{
throw
err
})
}
})
})
})
})
callback
(
err
)
callback
(
err
)
})
},
/* ===== GitLab ===== */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment