@razzium/piece-aimw-api 0.0.15 → 0.0.16
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 +1 -1
- package/src/index.ts +4 -3
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -57,16 +57,17 @@ export const openaiAuth = PieceAuth.SecretText({
|
|
|
57
57
|
authentication: {
|
|
58
58
|
type: AuthenticationType.BEARER_TOKEN,
|
|
59
59
|
token: auth.auth as string,
|
|
60
|
-
//token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImZjY2Y4NzQyLTUyZWItNDdmZS05YWNjLTFjYzUyZjc2ZDdkYiJ9.NSWnWMO0ERGRU3QT4are2u-fo7R1FJxb2byyIwInTj4",
|
|
61
60
|
},
|
|
62
61
|
});
|
|
63
62
|
return {
|
|
64
63
|
valid: true,
|
|
65
64
|
};
|
|
66
|
-
} catch (e) {
|
|
65
|
+
} catch (e: any) {
|
|
66
|
+
console.error('Auth validation error:', e?.message || e);
|
|
67
|
+
const errorMessage = e?.message || e?.response?.data?.message || 'Invalid API key';
|
|
67
68
|
return {
|
|
68
69
|
valid: false,
|
|
69
|
-
error:
|
|
70
|
+
error: errorMessage,
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
},
|