Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nikgraf committed Jul 4, 2024
1 parent 081778d commit 4168562
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
19 changes: 13 additions & 6 deletions apps/app/src/hooks/useLogin/useLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const useLogin = () => {

if (document.hasStorageAccess) {
document.hasStorageAccess().then(async (hasAccess) => {
console.log("LALA", hasAccess);
if (!hasAccess) {
document
.requestStorageAccess()
Expand All @@ -60,21 +61,27 @@ export const useLogin = () => {
} else {
// Storage access already granted
console.log("wow2");
const { success } = await loginFinishMutation.mutateAsync({
finishLoginRequest,
userIdentifier,
});
try {
const { success } = await loginFinishMutation.mutateAsync({
finishLoginRequest,
userIdentifier,
});

queryClient.invalidateQueries();
queryClient.invalidateQueries();

return success ? sessionKey : null;
return success ? sessionKey : null;
} catch (error) {
console.log("error2", error);
return null;
}
}
});
} else {
// Browser does not support Storage Access API
console.log("Browser does not support Storage Access API.");
}
} catch (error) {
console.log("error", error);
return null;
} finally {
setIsPending(false);
Expand Down
4 changes: 4 additions & 0 deletions apps/app/vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"rewrites": [
{
"source": "/api/:match*",
"destination": "https://automerge-jumpstart.fly.dev/:match*"
},
{
"source": "/(.*)",
"destination": "/index.html"
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/trpc/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const createContext = async ({
? {
secure: true,
sameSite: "none",
// partitioned: true,
partitioned: true,
}
: {
secure: false,
Expand Down

0 comments on commit 4168562

Please sign in to comment.