Skip to content

Commit

Permalink
fix: check for window.location (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
horsefacts committed Jan 26, 2024
1 parent 181e0e8 commit 5931f5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-hornets-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farcaster/auth-kit": patch
---

fix: check window.location for RN compatibility
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ export interface AuthKitContextValues {
onSignOut: () => void;
}

const domainDefaults = window.location ? {
domain: window.location.host,
siweUri: window.location.href
} : {};

const configDefaults = {
relay: "https://relay.farcaster.xyz",
version: "v1",
domain: window.location.host,
siweUri: window.location.href
...domainDefaults
};

export const AuthKitContext = createContext<AuthKitContextValues>({
Expand Down

0 comments on commit 5931f5a

Please sign in to comment.