Skip to content

Commit

Permalink
auth: @0.1.7 - cleaned up exports and namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
artemis-prime committed Feb 23, 2024
1 parent f623a1f commit ac836e6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pkgs/hanzo-auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export { default as LoginComponent } from './components/login'
export { useCurrentUser, type AuthService, AuthServiceProvider } from './service/AuthContext'
export type { default as APIResponse} from './lib/firebase/api-response'

5 changes: 5 additions & 0 deletions pkgs/hanzo-auth/lib/firebase/api-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type APIResponse<T = object> = { success: true; data: T } | { success: false; error: string };

export {
type APIResponse as default
}
3 changes: 1 addition & 2 deletions pkgs/hanzo-auth/lib/firebase/auth.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FacebookAuthProvider, GoogleAuthProvider, GithubAuthProvider, signInWithPopup } from 'firebase/auth'

import { auth } from './firebase'

export type APIResponse<T = object> = { success: true; data: T } | { success: false; error: string };
import type APIResponse from './api-response'

export async function signInWithProvider(provider: string): Promise<{success: boolean, email?: string | null}> {

Expand Down
2 changes: 1 addition & 1 deletion pkgs/hanzo-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hanzo/auth",
"version": "0.1.5",
"version": "0.1.7",
"description": "Library with Firebase authentication.",
"publishConfig": {
"registry": "https://registry.npmjs.org/",
Expand Down
9 changes: 8 additions & 1 deletion pkgs/hanzo-auth/server.ts
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
export { getCurrentUser as getCurrentUserServerSide} from './lib/firebase/firebase-admin'
export {
getCurrentUser as getCurrentUserServerSide,
createSessionCookie,
revokeAllSessions,
isUserAuthenticated
} from './lib/firebase/firebase-admin'

export type { default as APIResponse} from './lib/firebase/api-response'

0 comments on commit ac836e6

Please sign in to comment.