This repository has been archived on 2024-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
rocketchat-scim/src/errors/UnauthorizedError.ts

14 lines
527 B
TypeScript
Raw Normal View History

2022-02-15 15:16:51 +00:00
import { HttpStatusCode } from "@rocket.chat/apps-engine/definition/accessors";
import { SCIMError, SCIMErrorType } from "../scim/Error";
import { BaseError } from "./BaseError";
export class UnauthorizedError extends BaseError {
2022-05-03 12:17:30 +00:00
public message = "The username or password is missing or incorrect.";
2022-02-15 15:16:51 +00:00
public toSCIMError(): SCIMError {
return new SCIMError()
.setStatus(HttpStatusCode.UNAUTHORIZED)
.setScimType(SCIMErrorType.INVALID_SYNTAX)
.setDetail(this.message);
}
}