fix(signup): signup auth (#15628)
* fix(models.user): Colocate all user methods Moved user methods/extensions into one file. Tracked down `next method called more than once` error and setting headers after their sent. Let regular error handler handle api errors as well. * feat(server.auth): Disable github account creation We are no longer allowing account creation through github * refactor(Auth): Move user identity link into models dir * feat(Disable link account login): This removes the ability to use a linked account t * feat(errorhandlers): Add opbeat, filter out handled error
This commit is contained in:
committed by
mrugesh mohapatra
parent
7805d74ea7
commit
2fcd976700
18
server/utils/create-handled-error.js
Normal file
18
server/utils/create-handled-error.js
Normal file
@ -0,0 +1,18 @@
|
||||
const _handledError = Symbol('handledError');
|
||||
|
||||
export function isHandledError(err) {
|
||||
return !!err[_handledError];
|
||||
}
|
||||
|
||||
export function unwrapHandledError(err) {
|
||||
return err[_handledError] || {};
|
||||
}
|
||||
|
||||
export function wrapHandledError(err, {
|
||||
type,
|
||||
message,
|
||||
redirectTo
|
||||
}) {
|
||||
err[_handledError] = { type, message, redirectTo };
|
||||
return err;
|
||||
}
|
Reference in New Issue
Block a user