@volr/react 0.1.7 → 0.1.9
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.cjs +5 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -1879,7 +1879,7 @@ function createAxiosInstance(baseUrl, apiKey) {
|
|
|
1879
1879
|
// src/hooks/useVolrLogin.ts
|
|
1880
1880
|
function useVolrLogin() {
|
|
1881
1881
|
const { config, setUser } = useVolr();
|
|
1882
|
-
const {
|
|
1882
|
+
const { setAccessToken } = useInternalAuth();
|
|
1883
1883
|
const toVolrUser = useCallback((u) => {
|
|
1884
1884
|
return {
|
|
1885
1885
|
id: u.id,
|
|
@@ -1947,7 +1947,6 @@ function useVolrLogin() {
|
|
|
1947
1947
|
);
|
|
1948
1948
|
}
|
|
1949
1949
|
setAccessToken(accessToken);
|
|
1950
|
-
await refreshAccessToken();
|
|
1951
1950
|
if (userFromServer) {
|
|
1952
1951
|
setUser(toVolrUser(userFromServer));
|
|
1953
1952
|
} else {
|
|
@@ -1961,16 +1960,16 @@ function useVolrLogin() {
|
|
|
1961
1960
|
accessToken
|
|
1962
1961
|
};
|
|
1963
1962
|
},
|
|
1964
|
-
[api,
|
|
1963
|
+
[api, setAccessToken, setUser, toVolrUser]
|
|
1965
1964
|
);
|
|
1966
1965
|
const handleSocialLogin = useCallback(
|
|
1967
1966
|
async (provider) => {
|
|
1968
1967
|
if (typeof window !== "undefined") {
|
|
1969
1968
|
const baseUrl = apiBaseUrl.replace(/\/+$/, "");
|
|
1970
|
-
window.location.href = `${baseUrl}/auth/${provider}`;
|
|
1969
|
+
window.location.href = `${baseUrl}/auth/${provider}?projectApiKey=${encodeURIComponent(config.projectApiKey)}`;
|
|
1971
1970
|
}
|
|
1972
1971
|
},
|
|
1973
|
-
[apiBaseUrl]
|
|
1972
|
+
[apiBaseUrl, config.projectApiKey]
|
|
1974
1973
|
);
|
|
1975
1974
|
const requestSiweNonce = useCallback(async () => {
|
|
1976
1975
|
const response = await api.get("/auth/siwe/nonce");
|
|
@@ -2009,7 +2008,6 @@ function useVolrLogin() {
|
|
|
2009
2008
|
);
|
|
2010
2009
|
}
|
|
2011
2010
|
setAccessToken(accessToken);
|
|
2012
|
-
await refreshAccessToken();
|
|
2013
2011
|
if (userFromServer) {
|
|
2014
2012
|
setUser(toVolrUser(userFromServer));
|
|
2015
2013
|
}
|
|
@@ -2029,7 +2027,7 @@ function useVolrLogin() {
|
|
|
2029
2027
|
throw error;
|
|
2030
2028
|
}
|
|
2031
2029
|
},
|
|
2032
|
-
[api,
|
|
2030
|
+
[api, setAccessToken, setUser, toVolrUser]
|
|
2033
2031
|
);
|
|
2034
2032
|
const handlePasskeyComplete = useCallback(async () => {
|
|
2035
2033
|
}, []);
|