@b3dotfun/sdk 0.0.50-alpha.1 → 0.0.50-alpha.2
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.
|
@@ -171,7 +171,7 @@ function useAuthentication(partnerId) {
|
|
|
171
171
|
setIsConnected,
|
|
172
172
|
setUser,
|
|
173
173
|
]);
|
|
174
|
-
const logout = async (callback) => {
|
|
174
|
+
const logout = (0, react_2.useCallback)(async (callback) => {
|
|
175
175
|
if (activeWallet) {
|
|
176
176
|
debug("@@logout:activeWallet", activeWallet);
|
|
177
177
|
disconnect(activeWallet);
|
|
@@ -188,6 +188,7 @@ function useAuthentication(partnerId) {
|
|
|
188
188
|
localStorage.removeItem("thirdweb:connected-wallet-ids");
|
|
189
189
|
localStorage.removeItem("wagmi.store");
|
|
190
190
|
localStorage.removeItem("lastAuthProvider");
|
|
191
|
+
localStorage.removeItem("b3-user");
|
|
191
192
|
}
|
|
192
193
|
app_1.default.logout();
|
|
193
194
|
debug("@@logout:loggedOut");
|
|
@@ -195,7 +196,7 @@ function useAuthentication(partnerId) {
|
|
|
195
196
|
setIsConnected(false);
|
|
196
197
|
setUser();
|
|
197
198
|
callback?.();
|
|
198
|
-
};
|
|
199
|
+
}, [activeWallet, disconnect, wallets, setIsAuthenticated, setUser, setIsConnected]);
|
|
199
200
|
const { isLoading: useAutoConnectLoading } = (0, react_3.useAutoConnect)({
|
|
200
201
|
client: thirdweb_1.client,
|
|
201
202
|
wallets: [wallet],
|
|
@@ -165,7 +165,7 @@ export function useAuthentication(partnerId) {
|
|
|
165
165
|
setIsConnected,
|
|
166
166
|
setUser,
|
|
167
167
|
]);
|
|
168
|
-
const logout = async (callback) => {
|
|
168
|
+
const logout = useCallback(async (callback) => {
|
|
169
169
|
if (activeWallet) {
|
|
170
170
|
debug("@@logout:activeWallet", activeWallet);
|
|
171
171
|
disconnect(activeWallet);
|
|
@@ -182,6 +182,7 @@ export function useAuthentication(partnerId) {
|
|
|
182
182
|
localStorage.removeItem("thirdweb:connected-wallet-ids");
|
|
183
183
|
localStorage.removeItem("wagmi.store");
|
|
184
184
|
localStorage.removeItem("lastAuthProvider");
|
|
185
|
+
localStorage.removeItem("b3-user");
|
|
185
186
|
}
|
|
186
187
|
app.logout();
|
|
187
188
|
debug("@@logout:loggedOut");
|
|
@@ -189,7 +190,7 @@ export function useAuthentication(partnerId) {
|
|
|
189
190
|
setIsConnected(false);
|
|
190
191
|
setUser();
|
|
191
192
|
callback?.();
|
|
192
|
-
};
|
|
193
|
+
}, [activeWallet, disconnect, wallets, setIsAuthenticated, setUser, setIsConnected]);
|
|
193
194
|
const { isLoading: useAutoConnectLoading } = useAutoConnect({
|
|
194
195
|
client,
|
|
195
196
|
wallets: [wallet],
|
package/package.json
CHANGED
|
@@ -193,35 +193,39 @@ export function useAuthentication(partnerId: string) {
|
|
|
193
193
|
],
|
|
194
194
|
);
|
|
195
195
|
|
|
196
|
-
const logout =
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
196
|
+
const logout = useCallback(
|
|
197
|
+
async (callback?: () => void) => {
|
|
198
|
+
if (activeWallet) {
|
|
199
|
+
debug("@@logout:activeWallet", activeWallet);
|
|
200
|
+
disconnect(activeWallet);
|
|
201
|
+
debug("@@logout:activeWallet", activeWallet);
|
|
202
|
+
}
|
|
202
203
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
// Log out of each wallet
|
|
205
|
+
wallets.forEach(wallet => {
|
|
206
|
+
console.log("@@logging out", wallet);
|
|
207
|
+
disconnect(wallet);
|
|
208
|
+
});
|
|
208
209
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
// Delete localStorage thirdweb:connected-wallet-ids
|
|
211
|
+
// https://npc-labs.slack.com/archives/C070E6HNG85/p1750185115273099
|
|
212
|
+
if (typeof localStorage !== "undefined") {
|
|
213
|
+
localStorage.removeItem("thirdweb:connected-wallet-ids");
|
|
214
|
+
localStorage.removeItem("wagmi.store");
|
|
215
|
+
localStorage.removeItem("lastAuthProvider");
|
|
216
|
+
localStorage.removeItem("b3-user");
|
|
217
|
+
}
|
|
216
218
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
+
app.logout();
|
|
220
|
+
debug("@@logout:loggedOut");
|
|
219
221
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
setIsAuthenticated(false);
|
|
223
|
+
setIsConnected(false);
|
|
224
|
+
setUser();
|
|
225
|
+
callback?.();
|
|
226
|
+
},
|
|
227
|
+
[activeWallet, disconnect, wallets, setIsAuthenticated, setUser, setIsConnected],
|
|
228
|
+
);
|
|
225
229
|
|
|
226
230
|
const { isLoading: useAutoConnectLoading } = useAutoConnect({
|
|
227
231
|
client,
|