Skip to content

Commit

Permalink
create private onApplicationStart method
Browse files Browse the repository at this point in the history
  • Loading branch information
pKorsholm committed Jan 22, 2024
1 parent 6bd70d9 commit b57fde1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/authentication/src/providers/username-password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class UsernamePasswordProvider extends AbstractAuthenticationModuleProvider {
): Promise<AuthenticationResponse> {
const { email, password } = userData.body

if (isString(password)) {
if (!password || !isString(password)) {
return {
success: false,
error: "Password should be a string",
}
}

if (isString(email)) {
if (!email || !isString(email)) {
return {
success: false,
error: "Email should be a string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ export default class AuthenticationModuleService<
}

__hooks = {
onApplicationStart: this.createProvidersOnLoad,
onApplicationStart: async () => await this.createProvidersOnLoad(),
}


protected __container__: MedusaContainer
protected baseRepository_: DAL.RepositoryService

Expand Down

0 comments on commit b57fde1

Please sign in to comment.