Skip to content

Commit

Permalink
Minor updates after writing PR description
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jul 18, 2022
1 parent 52baee8 commit 87afc35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/auth/src/authFactory.ts
Expand Up @@ -38,5 +38,6 @@ export function createAuthentication<
const useAuth = createUseAuth(AuthContext)
const AuthProvider = createAuthProvider(AuthContext, authImplementation)

// TODO: Do we really need to return AuthContext here?
return { AuthContext, AuthProvider, useAuth }
}
4 changes: 4 additions & 0 deletions packages/auth/src/authImplementations/netlify.ts
@@ -1,5 +1,7 @@
import type * as NetlifyIdentityNS from 'netlify-identity-widget'

import { isBrowser } from '@redwoodjs/prerender/browserUtils'

import { createAuthentication } from 'src/authFactory'
// TODO:
// In the future, when this is a separate package, we can import the full thing
Expand All @@ -15,6 +17,8 @@ type User = NetlifyIdentityNS.User
export function createNetlifyAuth(netlifyIdentity: NetlifyIdentity) {
const authImplementation = createNetlifyAuthImplementation(netlifyIdentity)

isBrowser && netlifyIdentity.init()

return createAuthentication<
User,
User | null,
Expand Down

0 comments on commit 87afc35

Please sign in to comment.