Skip to content
  • Workflows
  • Bindings

kinde.auth

The kinde.auth binding affects the auth flow.

denyAccess(reason: string): void

Link to this section

Prevent the user from accessing the application.

Available in workflows

Link to this section
export const workflowSettings = {
// ...other settings
bindings: {"kinde.auth": {}}
};
Link to this section

The Kinde infrastructure library provides a type-safe helper:

import { denyAccess } from "@kinde/infrastructure";
export default async function (event: onUserTokenGeneratedEvent) {
if (event.request.ip.startsWith("192")) {
denyAccess("You are not allowed to access this resource");
}
}

Using the low-level API

Link to this section

If you’re not using the infrastructure library, you can call the underlying API directly:

kinde.auth.denyAccess("You are not allowed to access this resource");