@bananacool467/authtics 1.0.62 → 1.0.64
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/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -110,11 +110,11 @@ exports.authtics = {
|
|
|
110
110
|
return [
|
|
111
111
|
cookieParser(),
|
|
112
112
|
(req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
113
|
-
var _a;
|
|
113
|
+
var _a, _b;
|
|
114
114
|
if (req.path != '/api/authtics-integration/get-account' && req.path != '/api/authtics-integration/login' && req.path != '/api/authtics-integration/logout' && req.path != '/api/authtics-integration/code-exchanger') {
|
|
115
115
|
const userIp = req.ip;
|
|
116
116
|
const token = req.query.access_token;
|
|
117
|
-
const cookie =
|
|
117
|
+
//const cookie = req.cookies?.AUTHTICS_ACCOUNT_ACCESS_TOKEN;
|
|
118
118
|
if (token) {
|
|
119
119
|
res.cookie('AUTHTICS_ACCOUNT_ACCESS_TOKEN', token, {
|
|
120
120
|
httpOnly: true,
|
|
@@ -126,11 +126,11 @@ exports.authtics = {
|
|
|
126
126
|
delete remainingQueries.access_token;
|
|
127
127
|
return res.redirect(req.path);
|
|
128
128
|
}
|
|
129
|
-
req.authtics_token =
|
|
129
|
+
req.authtics_token = (_a = req.cookies) === null || _a === void 0 ? void 0 : _a.AUTHTICS_ACCOUNT_ACCESS_TOKEN;
|
|
130
130
|
next();
|
|
131
131
|
}
|
|
132
132
|
else if (req.path == '/api/authtics-integration/get-account') {
|
|
133
|
-
const token = req.authtics_token;
|
|
133
|
+
const token = req.authtics_token || ((_b = req.cookies) === null || _b === void 0 ? void 0 : _b.AUTHTICS_ACCOUNT_ACCESS_TOKEN);
|
|
134
134
|
const userIp = req.ip;
|
|
135
135
|
if (!token)
|
|
136
136
|
return res.status(401).json({ error: 'No session found.', redirect: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bananacool467/authtics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.64",
|
|
4
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",
|