@tempoxyz/auth 0.0.0-pr-66.sha-9ef83aa → 0.0.0-pr-66.sha-7651eb5
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/Decorator.d.ts +6 -2
- package/dist/Decorator.js +9 -4
- package/package.json +1 -1
package/dist/Decorator.d.ts
CHANGED
|
@@ -103,10 +103,14 @@ export declare namespace tempoAuth {
|
|
|
103
103
|
refresh: (options: Actions.refresh.Options) => ReturnType<typeof Actions.refresh>;
|
|
104
104
|
/**
|
|
105
105
|
* Rebuilds a stored authorization's account with `Key.toAccount`, sets the client's account to
|
|
106
|
-
* it, and returns the authorization.
|
|
106
|
+
* it, and returns the authorization. `Key.from` fills the key's `chainId` when a sign-in stored
|
|
107
|
+
* before it existed leaves it out. Throws `Key.AccessKeyRequiredError` for a key that carries
|
|
107
108
|
* no material without the `accessKey` the app supplied.
|
|
108
109
|
*/
|
|
109
|
-
restore: <id extends number = chainId>(authorization: Omit<Authorization<id>, 'account'
|
|
110
|
+
restore: <id extends number = chainId>(authorization: Omit<Authorization<id>, 'account' | 'key'> & {
|
|
111
|
+
/** The stored key, with or without its `chainId`. */
|
|
112
|
+
key: Key.from.Value<id>;
|
|
113
|
+
}, options?: Key.toAccount.Options) => Authorization<id>;
|
|
110
114
|
/** `Actions.signOut`, which empties the client's account, even when the request fails. */
|
|
111
115
|
signOut: () => Promise<void>;
|
|
112
116
|
tempoAccount: {
|
package/dist/Decorator.js
CHANGED
|
@@ -80,10 +80,15 @@ export function tempoAuth(options) {
|
|
|
80
80
|
start: (options = {}) => Actions.redirect.start(auth, options),
|
|
81
81
|
},
|
|
82
82
|
refresh: (options) => Actions.refresh(auth, options),
|
|
83
|
-
restore: (authorization, options = {}) =>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
restore: (authorization, options = {}) => {
|
|
84
|
+
// A sign-in stored before `Key.chainId` existed gains it here.
|
|
85
|
+
const key = Key.from(authorization.key);
|
|
86
|
+
return set({
|
|
87
|
+
...authorization,
|
|
88
|
+
account: Key.toAccount(key, options),
|
|
89
|
+
key,
|
|
90
|
+
});
|
|
91
|
+
},
|
|
87
92
|
async signOut() {
|
|
88
93
|
// The client stops signing even when the request fails, since the user asked to leave.
|
|
89
94
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempoxyz/auth",
|
|
3
|
-
"version": "0.0.0-pr-66.sha-
|
|
3
|
+
"version": "0.0.0-pr-66.sha-7651eb5",
|
|
4
4
|
"description": "Signs users in to Tempo through Tempo Auth, and returns Viem access key accounts on their Tempo Accounts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|