mirror of
https://github.com/detleph/server.git
synced 2026-09-04 08:36:06 +02:00
Add methods for requiring more specific levels of teamleader auth
+ Add AuthError
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import ForwardableError from "./ForwardableError";
|
||||
|
||||
export default class AuthError extends ForwardableError {
|
||||
protected __oid = "AUTH_ERROR";
|
||||
|
||||
constructor(message?: string) {
|
||||
super(403, message ?? "The request did not provide sufficient authentication");
|
||||
}
|
||||
|
||||
static isAuthError(err: any): err is AuthError {
|
||||
return err.__oid === "AUTH_ERROR";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user