@bananacool467/authtics 1.0.56 → 1.0.60

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 ADDED
@@ -0,0 +1,3 @@
1
+ This package was made by bananakitssu.
2
+
3
+ Authtics and this package is currently underdevelopment. It is not recommended to be used yet.
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Authtics - Open Source Authentication Utility
3
3
  * Developed by bananakitssu (github.com/bananakitssu)
4
4
  * This software is provided "as-is" for the community.
5
+ * (Authtics and this package is currently underdevelopment.)
5
6
  */
6
7
  /**
7
8
  * Gets the user based on the accessToken.
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  * Authtics - Open Source Authentication Utility
4
4
  * Developed by bananakitssu (github.com/bananakitssu)
5
5
  * This software is provided "as-is" for the community.
6
+ * (Authtics and this package is currently underdevelopment.)
6
7
  */
7
8
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
9
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -64,7 +65,7 @@ exports.authtics = {
64
65
  }
65
66
  else {
66
67
  const json = yield code.json();
67
- const newLink = window.location.href.replace('?code=' + searchParams.get('code'), json.accessToken).replace('&code=' + searchParams.get('code'), '&access_token=' + json.accessToken);
68
+ const newLink = window.location.href.replace('?code=' + searchParams.get('code'), '?access_token=' + json.accessToken).replace('&code=' + searchParams.get('code'), '&access_token=' + json.accessToken);
68
69
  window.location.href = newLink;
69
70
  }
70
71
  }
@@ -103,7 +104,7 @@ exports.authtics = {
103
104
  });
104
105
  const sendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
105
106
  });
106
- return [account, login, logout, sendRequest, carriedInfo];
107
+ return [account, authorized, login, logout, sendRequest, carriedInfo];
107
108
  },
108
109
  use: (clientId, clientSecret, flow) => {
109
110
  return [
@@ -133,8 +134,10 @@ exports.authtics = {
133
134
  const userIp = req.ip;
134
135
  if (!token)
135
136
  return res.status(401).json({ error: 'No session found.', redirect: true });
136
- const [account, error] = yield __runCurl__("https://eb29e77b-9bd2-4e3b-9469-81d3af2a8fbe-00-1ag45w1mgbsv1.picard.replit.dev/api/authtics/me", [{ k: "Authorization", v: token }, { k: "x-client-id", v: clientId }, { k: "x-client-secret", v: clientSecret }, { k: "Content-Type", v: "application/json" }]);
137
+ const [account, error] = yield __runCurl__("https://eb29e77b-9bd2-4e3b-9469-81d3af2a8fbe-00-1ag45w1mgbsv1.picard.replit.dev/api/authtics/me", [{ k: "Authorization", v: token }, { k: "x-client-id", v: clientId }, { k: "x-client-secret", v: clientSecret }, { k: "x-user-ip", v: userIp }, { k: "Content-Type", v: "application/json" }]);
137
138
  const extracted = yield JSON.parse(account);
139
+ if (error)
140
+ return res.status(404).text(error);
138
141
  if (extracted.error)
139
142
  return res.status(404).json({ error: extracted.error, redirect: true });
140
143
  if (extracted.message)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bananacool467/authtics",
3
- "version": "1.0.56",
4
- "description": "Use Authtics (An Auth service) to add accounts to your site like Auth0! (This is currently underdevelopment. Issues are expected.)",
3
+ "version": "1.0.60",
4
+ "description": "Use Authtics (An Auth service) to add accounts to your site like Auth0! (This is currently underdevelopment and Authtics is also underdevelopment. Issues are expected.)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [