-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge monitor branch and resolve conflicts
- Loading branch information
Showing
29 changed files
with
721 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import HTTPErrors from 'http-errors'; | ||
|
||
import { BusinessError } from './base'; | ||
|
||
export class BadAuthentication extends BusinessError { | ||
constructor( | ||
public readonly message: string, | ||
public readonly cause?: string, | ||
) { | ||
super(message, 'BAD_AUTHENTICATION', cause, HTTPErrors.Unauthorized); | ||
} | ||
} | ||
|
||
export class MissingAuthenticationHeaders extends BadAuthentication { | ||
constructor() { | ||
super('Missing authentication headers', 'Missing authentication headers'); | ||
} | ||
} | ||
|
||
export class InvalidCredentials extends BadAuthentication { | ||
constructor(public readonly cause: string) { | ||
super('Bad authentication', cause); | ||
} | ||
} | ||
|
||
export class UserNotFound extends InvalidCredentials { | ||
constructor(public readonly username: string) { | ||
super(`User ${username} not found`); | ||
} | ||
} | ||
|
||
export class IncorrectPassword extends InvalidCredentials { | ||
constructor(public readonly username: string) { | ||
super(`Password for ${username} does not match`); | ||
} | ||
} | ||
|
||
export class JWTInvalid extends InvalidCredentials { | ||
constructor(public readonly cause: string) { | ||
super(`JWT token invalid, ${cause}`); | ||
} | ||
} |
Oops, something went wrong.