mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
b55c85783b
feat: Add Reset token functionality This allows admin users to create a reset token for other users. Thus allowing resetting their password. Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com> fixes: #778
25 lines
566 B
TypeScript
25 lines
566 B
TypeScript
class InvalidTokenError extends Error {
|
|
constructor() {
|
|
super();
|
|
Error.captureStackTrace(this, this.constructor);
|
|
this.name = this.constructor.name;
|
|
this.message = 'Token was not valid';
|
|
}
|
|
|
|
toJSON(): any {
|
|
const obj = {
|
|
isJoi: true,
|
|
name: this.constructor.name,
|
|
details: [
|
|
{
|
|
message: this.message,
|
|
},
|
|
],
|
|
};
|
|
return obj;
|
|
}
|
|
}
|
|
|
|
export default InvalidTokenError;
|
|
module.exports = InvalidTokenError;
|