@tthr/vue 0.0.78 → 0.0.80
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Executes local custom functions or proxies generic CRUD to Tether API
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { defineEventHandler, readBody, createError, getHeader, setResponseStatus } from 'h3';
|
|
6
|
+
import { defineEventHandler, readBody, createError, getHeader, getCookie, setResponseStatus } from 'h3';
|
|
7
7
|
import { useRuntimeConfig } from '#imports';
|
|
8
8
|
|
|
9
9
|
// Dynamic function registry - populated on first request
|
|
@@ -284,10 +284,11 @@ export default defineEventHandler(async (event) => {
|
|
|
284
284
|
// Check for Strands auth token in cookie or header
|
|
285
285
|
const authHeader = getHeader(event, 'authorization');
|
|
286
286
|
const strandsToken = getHeader(event, 'x-strands-token');
|
|
287
|
+
const cookieToken = getCookie(event, 'strands_oauth_token');
|
|
287
288
|
|
|
288
289
|
// If using Strands auth, validate the token via Tether server
|
|
289
|
-
if (strandsToken || authHeader?.startsWith('Bearer ')) {
|
|
290
|
-
const token = strandsToken || authHeader?.replace('Bearer ', '');
|
|
290
|
+
if (strandsToken || cookieToken || authHeader?.startsWith('Bearer ')) {
|
|
291
|
+
const token = strandsToken || cookieToken || authHeader?.replace('Bearer ', '');
|
|
291
292
|
if (token) {
|
|
292
293
|
try {
|
|
293
294
|
// Validate token via Tether server (which checks if Strands Auth is enabled)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Executes local custom functions or proxies generic CRUD to Tether API
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { defineEventHandler, readBody, createError, getHeader } from 'h3';
|
|
6
|
+
import { defineEventHandler, readBody, createError, getHeader, getCookie } from 'h3';
|
|
7
7
|
import { useRuntimeConfig } from '#imports';
|
|
8
8
|
|
|
9
9
|
// Dynamic function registry - populated on first request
|
|
@@ -284,10 +284,11 @@ export default defineEventHandler(async (event) => {
|
|
|
284
284
|
// Check for Strands auth token in cookie or header
|
|
285
285
|
const authHeader = getHeader(event, 'authorization');
|
|
286
286
|
const strandsToken = getHeader(event, 'x-strands-token');
|
|
287
|
+
const cookieToken = getCookie(event, 'strands_oauth_token');
|
|
287
288
|
|
|
288
289
|
// If using Strands auth, validate the token via Tether server
|
|
289
|
-
if (strandsToken || authHeader?.startsWith('Bearer ')) {
|
|
290
|
-
const token = strandsToken || authHeader?.replace('Bearer ', '');
|
|
290
|
+
if (strandsToken || cookieToken || authHeader?.startsWith('Bearer ')) {
|
|
291
|
+
const token = strandsToken || cookieToken || authHeader?.replace('Bearer ', '');
|
|
291
292
|
if (token) {
|
|
292
293
|
try {
|
|
293
294
|
// Validate token via Tether server (which checks if Strands Auth is enabled)
|