Skip to content

Commit

Permalink
Fixes types
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Apr 4, 2024
1 parent cddf328 commit 6e843a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion waspc/data/Generator/templates/sdk/wasp/auth/types.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// todo(filip): turn into a proper import/path
export type { ProviderName, DeserializedAuthIdentity } from 'wasp/server/_types'
export type { ProviderName } from 'wasp/server/_types'
4 changes: 2 additions & 2 deletions waspc/data/Generator/templates/sdk/wasp/auth/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type {= authEntityName =},
type {= authIdentityEntityName =},
} from 'wasp/entities'
import type { ProviderName, DeserializedAuthIdentity } from './types'
import { type ProviderName } from './types'
import { type PossibleProviderData, deserializeAndSanitizeProviderData } from './utils.js'

// PUBLIC API
Expand All @@ -27,7 +27,7 @@ export function getFirstProviderUserId(user?: UserEntityWithAuth): string | null
}

// PUBLIC API
export function findUserIdentity(user: UserEntityWithAuth, providerName: ProviderName): DeserializedAuthIdentity | undefined {
export function findUserIdentity(user: UserEntityWithAuth, providerName: ProviderName): {= authIdentityEntityName =} | undefined {
return user.auth.identities.find(
(identity) => identity.providerName === providerName
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,5 @@ type Context<Entities extends _Entity[]> = Expand<{
{=# isAuthEnabled =}
type ContextWithUser<Entities extends _Entity[]> = Expand<Context<Entities> & { user?: AuthUser }>

export type DeserializedAuthIdentity = Expand<Omit<{= authIdentityEntityName =}, 'providerData'> & {
providerData: Omit<EmailProviderData, 'password'> | Omit<UsernameProviderData, 'password'> | OAuthProviderData
}>

export type { ProviderName } from 'wasp/auth/utils'
{=/ isAuthEnabled =}

0 comments on commit 6e843a4

Please sign in to comment.