@atlasauth/expo-passkeys 0.1.0 → 0.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/CHANGELOG.md +18 -0
- package/dist/client.js +7 -1
- package/dist/client.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @atlasauth/expo-passkeys changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
- **`frontendApi` is validated at client creation.** A missing, empty or malformed value now throws an
|
|
5
|
+
`AtlasConfigError` (from `@atlasauth/js`; `code: 'FRONTEND_API_REQUIRED'` or `'FRONTEND_API_INVALID'`)
|
|
6
|
+
instead of silently sending requests to relative URLs on the app's own origin. Accepted: an absolute
|
|
7
|
+
`https:` URL (`http:` only for localhost / local development hosts). Native apps have no origin of their own, so `"same-origin"` is refused.
|
|
8
|
+
|
|
9
|
+
## 0.1.0
|
|
10
|
+
|
|
11
|
+
First published release.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- `registerPasskey()` runs the passkey registration ceremony against Atlas on Expo / React Native.
|
|
15
|
+
- `authenticateWithPasskey()` signs in with a passkey.
|
|
16
|
+
- `toRegistrationFinishBody()` and `toAssertionFinishBody()` map native authenticator results to the Atlas request bodies.
|
|
17
|
+
- `createFapiClient()` / `AtlasFapiConfig` for configuring the Atlas instance.
|
|
18
|
+
- Works with `react-native-passkey`, passed in as an optional peer and never imported directly.
|
package/dist/client.js
CHANGED
|
@@ -4,6 +4,12 @@ exports.createFapiClient = createFapiClient;
|
|
|
4
4
|
const js_1 = require("@atlasauth/js");
|
|
5
5
|
/** Build a bearer-authenticated `@atlasauth/js` FapiClient from the config. */
|
|
6
6
|
function createFapiClient(config) {
|
|
7
|
+
// A native app has no origin of its own: a missing value, "same-origin" or a
|
|
8
|
+
// bare path throws an `AtlasConfigError` instead of producing relative URLs.
|
|
9
|
+
const baseUrl = (0, js_1.resolveFrontendApi)(config.frontendApi, {
|
|
10
|
+
component: 'createFapiClient()',
|
|
11
|
+
allowSameOrigin: false,
|
|
12
|
+
});
|
|
7
13
|
const base = config.fetchImpl ?? fetch;
|
|
8
14
|
const fetchImpl = async (input, init) => {
|
|
9
15
|
const headers = new Headers(init?.headers);
|
|
@@ -14,7 +20,7 @@ function createFapiClient(config) {
|
|
|
14
20
|
};
|
|
15
21
|
return new js_1.FapiClient({
|
|
16
22
|
publishableKey: config.publishableKey,
|
|
17
|
-
baseUrl
|
|
23
|
+
baseUrl,
|
|
18
24
|
fetchImpl,
|
|
19
25
|
});
|
|
20
26
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;AAqBA,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;AAqBA,4CAmBC;AAxCD,sCAA+D;AAoB/D,+EAA+E;AAC/E,SAAgB,gBAAgB,CAAC,MAAuB;IACtD,6EAA6E;IAC7E,6EAA6E;IAC7E,MAAM,OAAO,GAAG,IAAA,uBAAkB,EAAC,MAAM,CAAC,WAAW,EAAE;QACrD,SAAS,EAAE,oBAAoB;QAC/B,eAAe,EAAE,KAAK;KACvB,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC;IACvC,MAAM,SAAS,GAAiB,KAAK,EAAE,KAAwB,EAAE,IAAkB,EAAE,EAAE;QACrF,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/D,IAAI,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC;IACF,OAAO,IAAI,eAAU,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,OAAO;QACP,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/expo-passkeys",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@atlasauth/js": "0.
|
|
7
|
+
"@atlasauth/js": "0.6.0"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"react-native": ">=0.73",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist",
|
|
30
|
-
"README.md"
|
|
30
|
+
"README.md",
|
|
31
|
+
"CHANGELOG.md"
|
|
31
32
|
],
|
|
32
33
|
"scripts": {
|
|
33
34
|
"build": "tsc -p tsconfig.build.json",
|