-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix validateUserByPayload last_token_at Compare jwt
iattz
- Loading branch information
Showing
18 changed files
with
153 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export interface IJwtPayload { | ||
id: string; | ||
iat?: number; | ||
exp?: number; | ||
iattz?: string; | ||
id: string; // 'aac87c0a-887f-468a-9596-4be051ce3510' | ||
exp?: number; // 1593108804 | ||
iat?: number; // 1590516804 | ||
iattz?: string; // '2020-05-26T18:13:24.639Z' | ||
} |
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 @@ | ||
export * from './not-found-ip.exception'; |
31 changes: 31 additions & 0 deletions
31
packages/leaa-api/src/exceptions/not-found-ip.exception.ts
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,31 @@ | ||
import { HttpException, HttpStatus } from '@nestjs/common'; | ||
|
||
export class NotFoundIpException extends HttpException { | ||
/** | ||
* Instantiate a `NotFoundIpException` Exception. | ||
* | ||
* @example | ||
* `throw new NotFoundIpException()` | ||
* | ||
* @usageNotes | ||
* The HTTP response status code will be 404. | ||
* - The `objectOrError` argument defines the JSON response body or the message string. | ||
* - The `description` argument contains a short description of the HTTP error. | ||
* | ||
* By default, the JSON response body contains two properties: | ||
* - `statusCode`: this will be the value 404. | ||
* - `message`: the string `'Not Found'` by default; override this by supplying | ||
* a string in the `objectOrError` parameter. | ||
* | ||
* If the parameter `objectOrError` is a string, the response body will contain an | ||
* additional property, `error`, with a short description of the HTTP error. To override the | ||
* entire JSON response body, pass an object instead. Nest will serialize the object | ||
* and return it as the JSON response body. | ||
* | ||
* @param objectOrError string or object describing the error condition. | ||
* @param description a short description of the HTTP error. | ||
*/ | ||
constructor(objectOrError?: string | object | any, description = 'Not Found IP') { | ||
super(HttpException.createBody(objectOrError, description, HttpStatus.NOT_FOUND), HttpStatus.NOT_FOUND); | ||
} | ||
} |
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
Oops, something went wrong.