Add methods for requiring more specific levels of teamleader auth

+ Add AuthError
This commit is contained in:
Stephan
2022-05-27 23:08:23 +02:00
parent a9c182cf64
commit 2a33b703bc
5 changed files with 52 additions and 3 deletions
+13
View File
@@ -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";
}
}