@next-nest-auth/nestauth 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -105,7 +105,7 @@ To test if the installation is successful, call POST -> `http://localhost:3000/n
105
105
 
106
106
  ### 6 Refresh tokens
107
107
 
108
- To refresh your token call GET -> `http://localhost:3000/nestauth/refresh_token` with your params `refresh_token` with value `your-refresh-token`
108
+ To refresh your token call POST -> `http://localhost:3000/nestauth/refresh-token` with your params `refresh_token` with value `your-refresh-token`
109
109
 
110
110
  #### On Success
111
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-nest-auth/nestauth",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -9,6 +9,7 @@ import {
9
9
  HttpStatus,
10
10
  All,
11
11
  UseFilters,
12
+ BadRequestException,
12
13
  } from "@nestjs/common";
13
14
  import { NestAuthService } from "./nestauth.service";
14
15
  import { NestAuthLocalGuard } from "./nestauth-local.guard";
@@ -34,6 +35,9 @@ export class NestAuthController {
34
35
 
35
36
  @Post("refresh-token")
36
37
  refreshToken(@Body() params: { refresh_token: string }): Promise<any> {
38
+ if (!params.refresh_token) {
39
+ throw new BadRequestException("Invalid or expired refresh token");
40
+ }
37
41
  return this.nestAuthService.refreshToken(params.refresh_token);
38
42
  }
39
43