moc-oauth-client 3.0.0 → 3.0.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
@@ -66,7 +66,7 @@ console.log(result);
66
66
  ✅ Validate Access Token
67
67
 
68
68
  ```typescript
69
- const result = await oauth.validateToken(accessToken);
69
+ const result = await oauth.validateAuthorizationCode(code);
70
70
 
71
71
  console.log(result);
72
72
  ```
@@ -78,7 +78,12 @@ console.log(result);
78
78
  "data": {
79
79
  "isValid": true,
80
80
  "accessToken": "...",
81
- "refreshToken": "..."
81
+ "refreshToken": "...",
82
+ "domain": "...",
83
+ "id": "...",
84
+ "email": "...",
85
+ "username": "...",
86
+ "isActive": "..."
82
87
  },
83
88
  "error": null
84
89
  }
@@ -144,7 +149,7 @@ Example handling:
144
149
 
145
150
  ```typescript
146
151
  try {
147
- await oauth.validateToken(token);
152
+ await oauth.validateAuthorizationCode(code);
148
153
  } catch (error) {
149
154
  console.error(error.error.message);
150
155
  }
package/dist/index.js CHANGED
@@ -57,7 +57,8 @@ var http = import_axios.default.create({
57
57
  baseURL: config.baseUrl,
58
58
  headers: {
59
59
  "Content-Type": "application/json",
60
- "x-client-id": config.clientId
60
+ "x-client-id": config.clientId,
61
+ "x-client-secret": config.clientSecret
61
62
  }
62
63
  });
63
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moc-oauth-client",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "OAuth client for Ministry of Commerce, Cambodia",
5
5
  "author": "Ministry of Commerce, Cambodia",
6
6
  "license": "MIT",