@meistrari/auth-core 1.1.0 → 1.1.1
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.mjs +4 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { ssoClient } from '@better-auth/sso/client';
|
|
|
5
5
|
import { createAccessControl } from 'better-auth/plugins/access';
|
|
6
6
|
import { defaultStatements } from 'better-auth/plugins/organization/access';
|
|
7
7
|
|
|
8
|
-
const version = "1.1.
|
|
8
|
+
const version = "1.1.1";
|
|
9
9
|
|
|
10
10
|
const statements = {
|
|
11
11
|
...defaultStatements,
|
|
@@ -78,6 +78,8 @@ const customEndpointsPluginClient = () => {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
function createAPIClient(apiUrl, headers) {
|
|
81
|
+
const serviceName = typeof process !== "undefined" ? process.env.SERVICE_NAME : "";
|
|
82
|
+
const userAgent = `auth-sdk:core:${version}${serviceName ? `@${serviceName}` : ""}`;
|
|
81
83
|
return createAuthClient({
|
|
82
84
|
baseURL: apiUrl,
|
|
83
85
|
plugins: [
|
|
@@ -112,7 +114,7 @@ function createAPIClient(apiUrl, headers) {
|
|
|
112
114
|
fetchOptions: {
|
|
113
115
|
credentials: "include",
|
|
114
116
|
headers: {
|
|
115
|
-
"User-Agent":
|
|
117
|
+
"User-Agent": userAgent,
|
|
116
118
|
...headers
|
|
117
119
|
},
|
|
118
120
|
throw: true
|