Skip to content

Commit

Permalink
Fix account registration exports
Browse files Browse the repository at this point in the history
Destructuring the implemenation and exporting its functions does not
work because it only happens when the module evaluates. Instead, we can
export wrapped versions of the implementation functions.
  • Loading branch information
bgins committed Mar 14, 2022
1 parent 787db78 commit 59287f7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { impl } from "./implementation.js"

const { isUsernameAvailable, isUsernameValid, register } = impl
export const register = async (options: { username: string; email: string }): Promise<{ success: boolean }> => {
return impl.register(options)
}

export const isUsernameValid = async (username: string): Promise<boolean> => {
return impl.isUsernameValid(username)
}

export const isUsernameAvailable = async (username: string): Promise<boolean> => {
return impl.isUsernameAvailable(username)
}

export { isUsernameAvailable, isUsernameValid, register }
export { AccountLinkingRequestor, createConsumer as createRequestor } from "./linking/consumer.js"
export { AccountLinkingProvider, createProducer as createProvider } from "./linking/producer.js"

0 comments on commit 59287f7

Please sign in to comment.