not-node 6.0.0 → 6.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -34,6 +34,7 @@ class Identity {
34
34
  static getProviderName(req) {
35
35
  for (let providerName of this.#priorities) {
36
36
  if (this.getProvider(providerName).test(req)) {
37
+ console.log("identity provider type", providerName);
37
38
  return providerName;
38
39
  }
39
40
  }
@@ -30,6 +30,6 @@ module.exports = class notAppIdentity {
30
30
  }
31
31
 
32
32
  constructor(req) {
33
- return this.#identity.of(req);
33
+ return notAppIdentity.identity.of(req);
34
34
  }
35
35
  };
@@ -23,6 +23,8 @@ module.exports = class IdentityProviderToken {
23
23
 
24
24
  constructor(req) {
25
25
  this.req = req;
26
+ this.#extractToken(req);
27
+ this.#extractTokenContent();
26
28
  return this;
27
29
  }
28
30
 
@@ -30,13 +32,14 @@ module.exports = class IdentityProviderToken {
30
32
  const auth = req.get("Authorization");
31
33
  if (auth && auth.length) {
32
34
  const [, token] = auth.split(" ");
35
+ console.log("token found", token);
33
36
  return token;
34
37
  }
35
38
  return null;
36
39
  }
37
40
 
38
41
  #extractToken(req) {
39
- const token = this.getTokenFromRequest(req);
42
+ const token = IdentityProviderToken.getTokenFromRequest(req);
40
43
  if (token) {
41
44
  this.#token = token;
42
45
  }
@@ -50,7 +53,7 @@ module.exports = class IdentityProviderToken {
50
53
  #decodeTokenContent() {
51
54
  try {
52
55
  if (this.#token) {
53
- const secret = this.#getOptions().secret;
56
+ const secret = IdentityProviderToken.#getOptions().secret;
54
57
  JWT.verify(this.#token, secret);
55
58
  return JWT.decode(this.#token, secret);
56
59
  }
@@ -64,7 +67,7 @@ module.exports = class IdentityProviderToken {
64
67
  #encodeTokenContent() {
65
68
  try {
66
69
  if (this.#token) {
67
- const secret = this.#getOptions().secret;
70
+ const secret = IdentityProviderToken.#getOptions().secret;
68
71
  return JWT.sign(this.#tokenContent, secret);
69
72
  }
70
73
  return null;