14 lines
523 B
TypeScript
14 lines
523 B
TypeScript
|
import { HttpStatusCode } from "@rocket.chat/apps-engine/definition/accessors";
|
||
|
import { SCIMError, SCIMErrorType } from "../scim/Error";
|
||
|
import { BaseError } from "./BaseError";
|
||
|
|
||
|
export class UnauthorizedError extends BaseError {
|
||
|
public message = "The bearer token is missing or doesn't match.";
|
||
|
public toSCIMError(): SCIMError {
|
||
|
return new SCIMError()
|
||
|
.setStatus(HttpStatusCode.UNAUTHORIZED)
|
||
|
.setScimType(SCIMErrorType.INVALID_SYNTAX)
|
||
|
.setDetail(this.message);
|
||
|
}
|
||
|
}
|