Function: customAuthProvider()
customAuthProvider(
config):ExternalAuthProviderManifest
EXPERIMENTAL. Declares a hand-written external auth provider: an
AuthProvider implementation living in the app's own src/, referenced the
same way as any other user code.
This is the escape hatch under every adapter package -- anything a package
can do, an app can do locally. Prefer a published @wasp.sh/auth-* (or
community) adapter package when one exists for your provider.
Parameters
config
capabilities?
string[]
See ExternalAuthProviderManifest.capabilities.
env?
{ client?: EnvVarRequirement[]; server?: EnvVarRequirement[]; }
See ExternalAuthProviderManifest.env.
env.client?
env.server?
id
string
Stable identifier of the provider. Identities Wasp provisions for this
provider's subjects are recorded under this name, so it must stay stable
across deploys, and it must match the id of the AuthProvider object
the server module exports.
options?
unknown
See ExternalAuthProviderManifest.options.
server
Reference<AnyObject>
Reference to a user-code module exporting an AuthProvider object.
userSignupFields?
Reference<AnyObject>
See ExternalAuthProviderManifest.userSignupFields.
Returns
Example
import { customAuthProvider } from '@wasp.sh/spec'
import { myAuthProvider } from './src/auth/provider' with { type: 'ref' }
auth: {
userEntity: "User",
onAuthFailedRedirectTo: "/login",
provider: customAuthProvider({ id: "my-provider", server: myAuthProvider }),
}