Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

providers/credentials

CredentialInput

Besides providing type safety inside CredentialsConfig.authorize it also determines how the credentials input fields will be rendered on the default sign in page.

Extends

  • Partial<JSX.IntrinsicElements["input"]>

Properties

about?

optional about: string | SignalLike<string>;
Inherited from

Partial.about

accept?

optional accept: string | SignalLike<string>;
Inherited from

Partial.accept

acceptCharset?

optional acceptCharset: string | SignalLike<string>;
Inherited from

Partial.acceptCharset

accessKey?

optional accessKey: string | SignalLike<string>;
Inherited from

Partial.accessKey

action?

optional action: string | SignalLike<string>;
Inherited from

Partial.action

allow?

optional allow: string | SignalLike<string>;
Inherited from

Partial.allow

allowFullScreen?

optional allowFullScreen: boolean | SignalLike<boolean>;
Inherited from

Partial.allowFullScreen

allowTransparency?

optional allowTransparency: boolean | SignalLike<boolean>;
Inherited from

Partial.allowTransparency

alt?

optional alt: string | SignalLike<string>;
Inherited from

Partial.alt

as?

optional as: string | SignalLike<string>;
Inherited from

Partial.as

async?

optional async: boolean | SignalLike<boolean>;
Inherited from

Partial.async

autoCapitalize?

optional autoCapitalize: 
  | "none"
  | "off"
  | "on"
  | "sentences"
  | "words"
  | "characters"
  | SignalLike<
  | "none"
  | "off"
  | "on"
  | "sentences"
  | "words"
| "characters">;
Inherited from

Partial.autoCapitalize

autoComplete?

optional autoComplete: string | SignalLike<string>;
Inherited from

Partial.autoComplete

autoCorrect?

optional autoCorrect: string | SignalLike<string>;
Inherited from

Partial.autoCorrect

autoFocus?

optional autoFocus: boolean | SignalLike<boolean>;
Inherited from

Partial.autoFocus

autoPlay?

optional autoPlay: boolean | SignalLike<boolean>;
Inherited from

Partial.autoPlay

autocapitalize?

optional autocapitalize: 
  | "none"
  | "off"
  | "on"
  | "sentences"
  | "words"
  | "characters"
  | SignalLike<
  | "none"
  | "off"
  | "on"
  | "sentences"
  | "words"
| "characters">;
Inherited from

Partial.autocapitalize

autocomplete?

optional autocomplete: string | SignalLike<string>;
Inherited from

Partial.autocomplete

autocorrect?

optional autocorrect: string | SignalLike<string>;
Inherited from

Partial.autocorrect

autofocus?

optional autofocus: boolean | SignalLike<boolean>;
Inherited from

Partial.autofocus

capture?

optional capture: string | boolean | SignalLike<string>;
Inherited from

Partial.capture

cellPadding?

optional cellPadding: string | number | SignalLike<string>;
Inherited from

Partial.cellPadding

cellSpacing?

optional cellSpacing: string | number | SignalLike<string>;
Inherited from

Partial.cellSpacing

challenge?

optional challenge: string | SignalLike<string>;
Inherited from

Partial.challenge

charSet?

optional charSet: string | SignalLike<string>;
Inherited from

Partial.charSet

checked?

optional checked: boolean | SignalLike<boolean>;
Inherited from

Partial.checked

children?

optional children: ComponentChildren;
Inherited from

Partial.children

cite?

optional cite: string | SignalLike<string>;
Inherited from

Partial.cite

class?

optional class: string | SignalLike<undefined | string>;
Inherited from

Partial.class

className?

optional className: string | SignalLike<undefined | string>;
Inherited from

Partial.className

colSpan?

optional colSpan: number | SignalLike<number>;
Inherited from

Partial.colSpan

cols?

optional cols: number | SignalLike<number>;
Inherited from

Partial.cols

content?

optional content: string | SignalLike<string>;
Inherited from

Partial.content

contentEditable?

optional contentEditable: boolean | SignalLike<boolean>;
Inherited from

Partial.contentEditable

contextMenu?

optional contextMenu: string | SignalLike<string>;
Inherited from

Partial.contextMenu

controls?

optional controls: boolean | SignalLike<boolean>;
Inherited from

Partial.controls

controlsList?

optional controlsList: string | SignalLike<string>;
Inherited from

Partial.controlsList

coords?

optional coords: string | SignalLike<string>;
Inherited from

Partial.coords

crossOrigin?

optional crossOrigin: string | SignalLike<string>;
Inherited from

Partial.crossOrigin

dangerouslySetInnerHTML?

optional dangerouslySetInnerHTML: {
  __html: string;
};
__html
__html: string;
Inherited from

Partial.dangerouslySetInnerHTML

data?

optional data: string | SignalLike<string>;
Inherited from

Partial.data

datatype?

optional datatype: string | SignalLike<string>;
Inherited from

Partial.datatype

dateTime?

optional dateTime: string | SignalLike<string>;
Inherited from

Partial.dateTime

decoding?

optional decoding: "async" | "auto" | "sync" | SignalLike<"async" | "auto" | "sync">;
Inherited from

Partial.decoding

default?

optional default: boolean | SignalLike<boolean>;
Inherited from

Partial.default

defaultChecked?

optional defaultChecked: boolean | SignalLike<boolean>;
Inherited from

Partial.defaultChecked

defaultValue?

optional defaultValue: string | SignalLike<string>;
Inherited from

Partial.defaultValue

defer?

optional defer: boolean | SignalLike<boolean>;
Inherited from

Partial.defer

dir?

optional dir: "auto" | "rtl" | "ltr" | SignalLike<"auto" | "rtl" | "ltr">;
Inherited from

Partial.dir

disablePictureInPicture?

optional disablePictureInPicture: boolean | SignalLike<boolean>;
Inherited from

Partial.disablePictureInPicture

disableRemotePlayback?

optional disableRemotePlayback: boolean | SignalLike<boolean>;
Inherited from

Partial.disableRemotePlayback

disabled?

optional disabled: boolean | SignalLike<boolean>;
Inherited from

Partial.disabled

download?

optional download: any;
Inherited from

Partial.download

draggable?

optional draggable: boolean | SignalLike<boolean>;
Inherited from

Partial.draggable

encType?

optional encType: string | SignalLike<string>;
Inherited from

Partial.encType

enterkeyhint?

optional enterkeyhint: 
  | "search"
  | "enter"
  | "done"
  | "go"
  | "next"
  | "previous"
  | "send"
  | SignalLike<
  | "search"
  | "enter"
  | "done"
  | "go"
  | "next"
  | "previous"
| "send">;
Inherited from

Partial.enterkeyhint

for?

optional for: string | SignalLike<string>;
Inherited from

Partial.for

form?

optional form: string | SignalLike<string>;
Inherited from

Partial.form

formAction?

optional formAction: string | SignalLike<string>;
Inherited from

Partial.formAction

formEncType?

optional formEncType: string | SignalLike<string>;
Inherited from

Partial.formEncType

formMethod?

optional formMethod: string | SignalLike<string>;
Inherited from

Partial.formMethod

formNoValidate?

optional formNoValidate: boolean | SignalLike<boolean>;
Inherited from

Partial.formNoValidate

formTarget?

optional formTarget: string | SignalLike<string>;
Inherited from

Partial.formTarget

frameBorder?

optional frameBorder: string | number | SignalLike<string | number>;
Inherited from

Partial.frameBorder

headers?

optional headers: string | SignalLike<string>;
Inherited from

Partial.headers

height?

optional height: string | number | SignalLike<string | number>;
Inherited from

Partial.height

hidden?

optional hidden: boolean | SignalLike<boolean>;
Inherited from

Partial.hidden

high?

optional high: number | SignalLike<number>;
Inherited from

Partial.high

href?

optional href: string | SignalLike<string>;
Inherited from

Partial.href

hrefLang?

optional hrefLang: string | SignalLike<string>;
Inherited from

Partial.hrefLang

htmlFor?

optional htmlFor: string | SignalLike<string>;
Inherited from

Partial.htmlFor

httpEquiv?

optional httpEquiv: string | SignalLike<string>;
Inherited from

Partial.httpEquiv

icon?

optional icon: string | SignalLike<string>;
Inherited from

Partial.icon

id?

optional id: string | SignalLike<string>;
Inherited from

Partial.id

inlist?

optional inlist: any;
Inherited from

Partial.inlist

inputMode?

optional inputMode: string | SignalLike<string>;
Inherited from

Partial.inputMode

integrity?

optional integrity: string | SignalLike<string>;
Inherited from

Partial.integrity

is?

optional is: string | SignalLike<string>;
Inherited from

Partial.is

itemID?

optional itemID: string | SignalLike<string>;
Inherited from

Partial.itemID

itemProp?

optional itemProp: string | SignalLike<string>;
Inherited from

Partial.itemProp

itemRef?

optional itemRef: string | SignalLike<string>;
Inherited from

Partial.itemRef

itemScope?

optional itemScope: boolean | SignalLike<boolean>;
Inherited from

Partial.itemScope

itemType?

optional itemType: string | SignalLike<string>;
Inherited from

Partial.itemType

jsx?

optional jsx: boolean;
Inherited from

Partial.jsx

key?

optional key: any;
Inherited from

Partial.key

keyParams?

optional keyParams: string | SignalLike<string>;
Inherited from

Partial.keyParams

keyType?

optional keyType: string | SignalLike<string>;
Inherited from

Partial.keyType

kind?

optional kind: string | SignalLike<string>;
Inherited from

Partial.kind

label?

optional label: string;
Overrides

Partial.label

lang?

optional lang: string | SignalLike<string>;
Inherited from

Partial.lang

list?

optional list: string | SignalLike<string>;
Inherited from

Partial.list

loading?

optional loading: "lazy" | "eager" | SignalLike<"lazy" | "eager">;
Inherited from

Partial.loading

loop?

optional loop: boolean | SignalLike<boolean>;
Inherited from

Partial.loop

low?

optional low: number | SignalLike<number>;
Inherited from

Partial.low

manifest?

optional manifest: string | SignalLike<string>;
Inherited from

Partial.manifest

marginHeight?

optional marginHeight: number | SignalLike<number>;
Inherited from

Partial.marginHeight

marginWidth?

optional marginWidth: number | SignalLike<number>;
Inherited from

Partial.marginWidth

max?

optional max: string | number | SignalLike<string>;
Inherited from

Partial.max

maxLength?

optional maxLength: number | SignalLike<number>;
Inherited from

Partial.maxLength

media?

optional media: string | SignalLike<string>;
Inherited from

Partial.media

mediaGroup?

optional mediaGroup: string | SignalLike<string>;
Inherited from

Partial.mediaGroup

method?

optional method: string | SignalLike<string>;
Inherited from

Partial.method

min?

optional min: string | number | SignalLike<string>;
Inherited from

Partial.min

minLength?

optional minLength: number | SignalLike<number>;
Inherited from

Partial.minLength

multiple?

optional multiple: boolean | SignalLike<boolean>;
Inherited from

Partial.multiple

muted?

optional muted: boolean | SignalLike<boolean>;
Inherited from

Partial.muted

name?

optional name: string | SignalLike<string>;
Inherited from

Partial.name

noValidate?

optional noValidate: boolean | SignalLike<boolean>;
Inherited from

Partial.noValidate

nomodule?

optional nomodule: boolean | SignalLike<boolean>;
Inherited from

Partial.nomodule

nonce?

optional nonce: string | SignalLike<string>;
Inherited from

Partial.nonce

onAbort?

optional onAbort: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onAbort

onAbortCapture?

optional onAbortCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onAbortCapture

onAnimationEnd?

optional onAnimationEnd: AnimationEventHandler<HTMLInputElement>;
Inherited from

Partial.onAnimationEnd

onAnimationEndCapture?

optional onAnimationEndCapture: AnimationEventHandler<HTMLInputElement>;
Inherited from

Partial.onAnimationEndCapture

onAnimationIteration?

optional onAnimationIteration: AnimationEventHandler<HTMLInputElement>;
Inherited from

Partial.onAnimationIteration

onAnimationIterationCapture?

optional onAnimationIterationCapture: AnimationEventHandler<HTMLInputElement>;
Inherited from

Partial.onAnimationIterationCapture

onAnimationStart?

optional onAnimationStart: AnimationEventHandler<HTMLInputElement>;
Inherited from

Partial.onAnimationStart

onAnimationStartCapture?

optional onAnimationStartCapture: AnimationEventHandler<HTMLInputElement>;
Inherited from

Partial.onAnimationStartCapture

onBeforeInput?

optional onBeforeInput: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onBeforeInput

onBeforeInputCapture?

optional onBeforeInputCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onBeforeInputCapture

onBlur?

optional onBlur: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onBlur

onBlurCapture?

optional onBlurCapture: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onBlurCapture

onCanPlay?

optional onCanPlay: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onCanPlay

onCanPlayCapture?

optional onCanPlayCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onCanPlayCapture

onCanPlayThrough?

optional onCanPlayThrough: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onCanPlayThrough

onCanPlayThroughCapture?

optional onCanPlayThroughCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onCanPlayThroughCapture

onChange?

optional onChange: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onChange

onChangeCapture?

optional onChangeCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onChangeCapture

onClick?

optional onClick: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onClick

onClickCapture?

optional onClickCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onClickCapture

onCompositionEnd?

optional onCompositionEnd: CompositionEventHandler<HTMLInputElement>;
Inherited from

Partial.onCompositionEnd

onCompositionEndCapture?

optional onCompositionEndCapture: CompositionEventHandler<HTMLInputElement>;
Inherited from

Partial.onCompositionEndCapture

onCompositionStart?

optional onCompositionStart: CompositionEventHandler<HTMLInputElement>;
Inherited from

Partial.onCompositionStart

onCompositionStartCapture?

optional onCompositionStartCapture: CompositionEventHandler<HTMLInputElement>;
Inherited from

Partial.onCompositionStartCapture

onCompositionUpdate?

optional onCompositionUpdate: CompositionEventHandler<HTMLInputElement>;
Inherited from

Partial.onCompositionUpdate

onCompositionUpdateCapture?

optional onCompositionUpdateCapture: CompositionEventHandler<HTMLInputElement>;
Inherited from

Partial.onCompositionUpdateCapture

onContextMenu?

optional onContextMenu: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onContextMenu

onContextMenuCapture?

optional onContextMenuCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onContextMenuCapture

onCopy?

optional onCopy: ClipboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onCopy

onCopyCapture?

optional onCopyCapture: ClipboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onCopyCapture

onCut?

optional onCut: ClipboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onCut

onCutCapture?

optional onCutCapture: ClipboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onCutCapture

onDblClick?

optional onDblClick: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onDblClick

onDblClickCapture?

optional onDblClickCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onDblClickCapture

onDrag?

optional onDrag: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDrag

onDragCapture?

optional onDragCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragCapture

onDragEnd?

optional onDragEnd: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragEnd

onDragEndCapture?

optional onDragEndCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragEndCapture

onDragEnter?

optional onDragEnter: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragEnter

onDragEnterCapture?

optional onDragEnterCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragEnterCapture

onDragExit?

optional onDragExit: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragExit

onDragExitCapture?

optional onDragExitCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragExitCapture

onDragLeave?

optional onDragLeave: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragLeave

onDragLeaveCapture?

optional onDragLeaveCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragLeaveCapture

onDragOver?

optional onDragOver: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragOver

onDragOverCapture?

optional onDragOverCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragOverCapture

onDragStart?

optional onDragStart: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragStart

onDragStartCapture?

optional onDragStartCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDragStartCapture

onDrop?

optional onDrop: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDrop

onDropCapture?

optional onDropCapture: DragEventHandler<HTMLInputElement>;
Inherited from

Partial.onDropCapture

onDurationChange?

optional onDurationChange: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onDurationChange

onDurationChangeCapture?

optional onDurationChangeCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onDurationChangeCapture

onEmptied?

optional onEmptied: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onEmptied

onEmptiedCapture?

optional onEmptiedCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onEmptiedCapture

onEncrypted?

optional onEncrypted: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onEncrypted

onEncryptedCapture?

optional onEncryptedCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onEncryptedCapture

onEnded?

optional onEnded: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onEnded

onEndedCapture?

optional onEndedCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onEndedCapture

onError?

optional onError: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onError

onErrorCapture?

optional onErrorCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onErrorCapture

onFocus?

optional onFocus: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onFocus

onFocusCapture?

optional onFocusCapture: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onFocusCapture

onFormData?

optional onFormData: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onFormData

onFormDataCapture?

optional onFormDataCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onFormDataCapture

onGotPointerCapture?

optional onGotPointerCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onGotPointerCapture

onGotPointerCaptureCapture?

optional onGotPointerCaptureCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onGotPointerCaptureCapture

onInput?

optional onInput: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onInput

onInputCapture?

optional onInputCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onInputCapture

onInvalid?

optional onInvalid: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onInvalid

onInvalidCapture?

optional onInvalidCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onInvalidCapture

onKeyDown?

optional onKeyDown: KeyboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onKeyDown

onKeyDownCapture?

optional onKeyDownCapture: KeyboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onKeyDownCapture

onKeyPress?

optional onKeyPress: KeyboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onKeyPress

onKeyPressCapture?

optional onKeyPressCapture: KeyboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onKeyPressCapture

onKeyUp?

optional onKeyUp: KeyboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onKeyUp

onKeyUpCapture?

optional onKeyUpCapture: KeyboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onKeyUpCapture

onLoad?

optional onLoad: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoad

onLoadCapture?

optional onLoadCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoadCapture

onLoadStart?

optional onLoadStart: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoadStart

onLoadStartCapture?

optional onLoadStartCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoadStartCapture

onLoadedData?

optional onLoadedData: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoadedData

onLoadedDataCapture?

optional onLoadedDataCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoadedDataCapture

onLoadedMetadata?

optional onLoadedMetadata: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoadedMetadata

onLoadedMetadataCapture?

optional onLoadedMetadataCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onLoadedMetadataCapture

onLostPointerCapture?

optional onLostPointerCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onLostPointerCapture

onLostPointerCaptureCapture?

optional onLostPointerCaptureCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onLostPointerCaptureCapture

onMouseDown?

optional onMouseDown: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseDown

onMouseDownCapture?

optional onMouseDownCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseDownCapture

onMouseEnter?

optional onMouseEnter: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseEnter

onMouseEnterCapture?

optional onMouseEnterCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseEnterCapture

onMouseLeave?

optional onMouseLeave: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseLeave

onMouseLeaveCapture?

optional onMouseLeaveCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseLeaveCapture

onMouseMove?

optional onMouseMove: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseMove

onMouseMoveCapture?

optional onMouseMoveCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseMoveCapture

onMouseOut?

optional onMouseOut: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseOut

onMouseOutCapture?

optional onMouseOutCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseOutCapture

onMouseOver?

optional onMouseOver: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseOver

onMouseOverCapture?

optional onMouseOverCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseOverCapture

onMouseUp?

optional onMouseUp: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseUp

onMouseUpCapture?

optional onMouseUpCapture: MouseEventHandler<HTMLInputElement>;
Inherited from

Partial.onMouseUpCapture

onPaste?

optional onPaste: ClipboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onPaste

onPasteCapture?

optional onPasteCapture: ClipboardEventHandler<HTMLInputElement>;
Inherited from

Partial.onPasteCapture

onPause?

optional onPause: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onPause

onPauseCapture?

optional onPauseCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onPauseCapture

onPlay?

optional onPlay: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onPlay

onPlayCapture?

optional onPlayCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onPlayCapture

onPlaying?

optional onPlaying: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onPlaying

onPlayingCapture?

optional onPlayingCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onPlayingCapture

onPointerCancel?

optional onPointerCancel: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerCancel

onPointerCancelCapture?

optional onPointerCancelCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerCancelCapture

onPointerDown?

optional onPointerDown: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerDown

onPointerDownCapture?

optional onPointerDownCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerDownCapture

onPointerEnter?

optional onPointerEnter: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerEnter

onPointerEnterCapture?

optional onPointerEnterCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerEnterCapture

onPointerLeave?

optional onPointerLeave: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerLeave

onPointerLeaveCapture?

optional onPointerLeaveCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerLeaveCapture

onPointerMove?

optional onPointerMove: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerMove

onPointerMoveCapture?

optional onPointerMoveCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerMoveCapture

onPointerOut?

optional onPointerOut: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerOut

onPointerOutCapture?

optional onPointerOutCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerOutCapture

onPointerOver?

optional onPointerOver: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerOver

onPointerOverCapture?

optional onPointerOverCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerOverCapture

onPointerUp?

optional onPointerUp: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerUp

onPointerUpCapture?

optional onPointerUpCapture: PointerEventHandler<HTMLInputElement>;
Inherited from

Partial.onPointerUpCapture

onProgress?

optional onProgress: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onProgress

onProgressCapture?

optional onProgressCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onProgressCapture

onRateChange?

optional onRateChange: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onRateChange

onRateChangeCapture?

optional onRateChangeCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onRateChangeCapture

onReset?

optional onReset: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onReset

onResetCapture?

optional onResetCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onResetCapture

onScroll?

optional onScroll: UIEventHandler<HTMLInputElement>;
Inherited from

Partial.onScroll

onScrollCapture?

optional onScrollCapture: UIEventHandler<HTMLInputElement>;
Inherited from

Partial.onScrollCapture

onSearch?

optional onSearch: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSearch

onSearchCapture?

optional onSearchCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSearchCapture

onSeeked?

optional onSeeked: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSeeked

onSeekedCapture?

optional onSeekedCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSeekedCapture

onSeeking?

optional onSeeking: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSeeking

onSeekingCapture?

optional onSeekingCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSeekingCapture

onSelect?

optional onSelect: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSelect

onSelectCapture?

optional onSelectCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSelectCapture

onStalled?

optional onStalled: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onStalled

onStalledCapture?

optional onStalledCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onStalledCapture

onSubmit?

optional onSubmit: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSubmit

onSubmitCapture?

optional onSubmitCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSubmitCapture

onSuspend?

optional onSuspend: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSuspend

onSuspendCapture?

optional onSuspendCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onSuspendCapture

onTimeUpdate?

optional onTimeUpdate: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onTimeUpdate

onTimeUpdateCapture?

optional onTimeUpdateCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onTimeUpdateCapture

onToggle?

optional onToggle: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onToggle

onTouchCancel?

optional onTouchCancel: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchCancel

onTouchCancelCapture?

optional onTouchCancelCapture: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchCancelCapture

onTouchEnd?

optional onTouchEnd: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchEnd

onTouchEndCapture?

optional onTouchEndCapture: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchEndCapture

onTouchMove?

optional onTouchMove: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchMove

onTouchMoveCapture?

optional onTouchMoveCapture: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchMoveCapture

onTouchStart?

optional onTouchStart: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchStart

onTouchStartCapture?

optional onTouchStartCapture: TouchEventHandler<HTMLInputElement>;
Inherited from

Partial.onTouchStartCapture

onTransitionEnd?

optional onTransitionEnd: TransitionEventHandler<HTMLInputElement>;
Inherited from

Partial.onTransitionEnd

onTransitionEndCapture?

optional onTransitionEndCapture: TransitionEventHandler<HTMLInputElement>;
Inherited from

Partial.onTransitionEndCapture

onVolumeChange?

optional onVolumeChange: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onVolumeChange

onVolumeChangeCapture?

optional onVolumeChangeCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onVolumeChangeCapture

onWaiting?

optional onWaiting: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onWaiting

onWaitingCapture?

optional onWaitingCapture: GenericEventHandler<HTMLInputElement>;
Inherited from

Partial.onWaitingCapture

onWheel?

optional onWheel: WheelEventHandler<HTMLInputElement>;
Inherited from

Partial.onWheel

onWheelCapture?

optional onWheelCapture: WheelEventHandler<HTMLInputElement>;
Inherited from

Partial.onWheelCapture

onfocusin?

optional onfocusin: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onfocusin

onfocusinCapture?

optional onfocusinCapture: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onfocusinCapture

onfocusout?

optional onfocusout: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onfocusout

onfocusoutCapture?

optional onfocusoutCapture: FocusEventHandler<HTMLInputElement>;
Inherited from

Partial.onfocusoutCapture

open?

optional open: boolean | SignalLike<boolean>;
Inherited from

Partial.open

optimum?

optional optimum: number | SignalLike<number>;
Inherited from

Partial.optimum

part?

optional part: string | SignalLike<string>;
Inherited from

Partial.part

pattern?

optional pattern: string | SignalLike<string>;
Inherited from

Partial.pattern

ping?

optional ping: string | SignalLike<string>;
Inherited from

Partial.ping

placeholder?

optional placeholder: string | SignalLike<string>;
Inherited from

Partial.placeholder

playsInline?

optional playsInline: boolean | SignalLike<boolean>;
Inherited from

Partial.playsInline

poster?

optional poster: string | SignalLike<string>;
Inherited from

Partial.poster

prefix?

optional prefix: string | SignalLike<string>;
Inherited from

Partial.prefix

preload?

optional preload: string | SignalLike<string>;
Inherited from

Partial.preload

property?

optional property: string | SignalLike<string>;
Inherited from

Partial.property

radioGroup?

optional radioGroup: string | SignalLike<string>;
Inherited from

Partial.radioGroup

readOnly?

optional readOnly: boolean | SignalLike<boolean>;
Inherited from

Partial.readOnly

readonly?

optional readonly: boolean | SignalLike<boolean>;
Inherited from

Partial.readonly

ref?

optional ref: Ref<HTMLInputElement>;
Inherited from

Partial.ref

referrerpolicy?

optional referrerpolicy: 
  | "origin"
  | "no-referrer"
  | "no-referrer-when-downgrade"
  | "origin-when-cross-origin"
  | "same-origin"
  | "strict-origin"
  | "strict-origin-when-cross-origin"
  | "unsafe-url"
  | SignalLike<
  | "origin"
  | "no-referrer"
  | "no-referrer-when-downgrade"
  | "origin-when-cross-origin"
  | "same-origin"
  | "strict-origin"
  | "strict-origin-when-cross-origin"
| "unsafe-url">;
Inherited from

Partial.referrerpolicy

rel?

optional rel: string | SignalLike<string>;
Inherited from

Partial.rel

required?

optional required: boolean | SignalLike<boolean>;
Inherited from

Partial.required

resource?

optional resource: string | SignalLike<string>;
Inherited from

Partial.resource

results?

optional results: number | SignalLike<number>;
Inherited from

Partial.results

reversed?

optional reversed: boolean | SignalLike<boolean>;
Inherited from

Partial.reversed

role?

optional role: string | SignalLike<string>;
Inherited from

Partial.role

rowSpan?

optional rowSpan: number | SignalLike<number>;
Inherited from

Partial.rowSpan

rows?

optional rows: number | SignalLike<number>;
Inherited from

Partial.rows

sandbox?

optional sandbox: string | SignalLike<string>;
Inherited from

Partial.sandbox

scope?

optional scope: string | SignalLike<string>;
Inherited from

Partial.scope

scoped?

optional scoped: boolean | SignalLike<boolean>;
Inherited from

Partial.scoped

scrolling?

optional scrolling: string | SignalLike<string>;
Inherited from

Partial.scrolling

seamless?

optional seamless: boolean | SignalLike<boolean>;
Inherited from

Partial.seamless

selected?

optional selected: boolean | SignalLike<boolean>;
Inherited from

Partial.selected

shape?

optional shape: string | SignalLike<string>;
Inherited from

Partial.shape

size?

optional size: number | SignalLike<number>;
Inherited from

Partial.size

sizes?

optional sizes: string | SignalLike<string>;
Inherited from

Partial.sizes

slot?

optional slot: string | SignalLike<string>;
Inherited from

Partial.slot

span?

optional span: number | SignalLike<number>;
Inherited from

Partial.span

spellCheck?

optional spellCheck: boolean | SignalLike<boolean>;
Inherited from

Partial.spellCheck

spellcheck?

optional spellcheck: boolean | SignalLike<boolean>;
Inherited from

Partial.spellcheck

src?

optional src: string | SignalLike<string>;
Inherited from

Partial.src

srcDoc?

optional srcDoc: string | SignalLike<string>;
Inherited from

Partial.srcDoc

srcLang?

optional srcLang: string | SignalLike<string>;
Inherited from

Partial.srcLang

srcSet?

optional srcSet: string | SignalLike<string>;
Inherited from

Partial.srcSet

srcset?

optional srcset: string | SignalLike<string>;
Inherited from

Partial.srcset

start?

optional start: number | SignalLike<number>;
Inherited from

Partial.start

step?

optional step: string | number | SignalLike<string | number>;
Inherited from

Partial.step

style?

optional style: string | CSSProperties | SignalLike<string | CSSProperties>;
Inherited from

Partial.style

summary?

optional summary: string | SignalLike<string>;
Inherited from

Partial.summary

tabIndex?

optional tabIndex: number | SignalLike<number>;
Inherited from

Partial.tabIndex

target?

optional target: string | SignalLike<string>;
Inherited from

Partial.target

title?

optional title: string | SignalLike<string>;
Inherited from

Partial.title

translate?

optional translate: "yes" | "no" | SignalLike<"yes" | "no">;
Inherited from

Partial.translate

type?

optional type: string | SignalLike<string>;
Inherited from

Partial.type

typeof?

optional typeof: string | SignalLike<string>;
Inherited from

Partial.typeof

useMap?

optional useMap: string | SignalLike<string>;
Inherited from

Partial.useMap

value?

optional value: string | number | string[] | SignalLike<string | number | string[]>;
Inherited from

Partial.value

vocab?

optional vocab: string | SignalLike<string>;
Inherited from

Partial.vocab

volume?

optional volume: string | number | SignalLike<string | number>;
Inherited from

Partial.volume

width?

optional width: string | number | SignalLike<string | number>;
Inherited from

Partial.width

wmode?

optional wmode: string | SignalLike<string>;
Inherited from

Partial.wmode

wrap?

optional wrap: string | SignalLike<string>;
Inherited from

Partial.wrap


CredentialsConfig<CredentialsInputs>

The Credentials Provider needs to be configured.

Extends

Type parameters

Type parameterValue
CredentialsInputs extends Record<string, CredentialInput>Record<string, CredentialInput>

Properties

authorize()

authorize: (credentials, request) => Awaitable<null | User>;

Gives full control over how you handle the credentials received from the user.

⚠️

There is no validation on the user inputs by default, so make sure you do so by a popular library like Zod

This method expects a User object to be returned for a successful login.

If an CredentialsSignin is thrown or null is returned, two things can happen:

  1. The user is redirected to the login page, with error=CredentialsSignin&code=credentials in the URL. code is configurable, see below.
  2. If you throw this error in a framework that handles form actions server-side, this error is thrown by the login form action, so you’ll need to handle it there.

In case of 1., generally, we recommend not hinting if the user for example gave a wrong username or password specifically, try rather something like “invalid-credentials”. Try to be as generic with client-side errors as possible.

To customize the error code, you can create a custom error that extends CredentialsSignin and throw it in authorize.

Example
class CustomError extends CredentialsSignin {
 code = "custom_error"
}
// URL will contain `error=CredentialsSignin&code=custom_error`
Example
async authorize(credentials, request) { // you have access to the original request as well
  if(!isValidCredentials(credentials)) {
     throw new CustomError()
  }
  return await getUser(credentials) // assuming it returns a User or null
}
Parameters
ParameterTypeDescription
credentialsPartial<Record<keyof CredentialsInputs, unknown>>The available keys are determined by CredentialInput.

Note
The existence/correctness of a field cannot be guaranteed at compile time,
so you should always validate the input before using it.

You can add basic validation depending on your use case,
or you can use a popular library like Zod for example.
requestRequestThe original request.
Returns

Awaitable<null | User>

credentials

credentials: CredentialsInputs;

id

id: string;

Uniquely identifies the provider in AuthConfig.providers It’s also part of the URL

Inherited from

CommonProviderOptions.id

name

name: string;

The provider name used on the default sign-in page’s sign-in button. For example if it’s “Google”, the corresponding button will say: “Sign in with Google”

Inherited from

CommonProviderOptions.name

type

type: "credentials";

See ProviderType

Overrides

CommonProviderOptions.type


CredentialsProviderType

type CredentialsProviderType: "Credentials";

default()

default<CredentialsInputs>(config): CredentialsConfig

The Credentials provider allows you to handle signing in with arbitrary credentials, such as a username and password, domain, or two factor authentication or hardware device (e.g. YubiKey U2F / FIDO).

It is intended to support use cases where you have an existing system you need to authenticate users against.

It comes with the constraint that users authenticated in this manner are not persisted in the database, and consequently that the Credentials provider can only be used if JSON Web Tokens are enabled for sessions.

⚠️

The functionality provided for credentials-based authentication is intentionally limited to discourage the use of passwords due to the inherent security risks of the username-password model.

OAuth providers spend significant amounts of money, time, and engineering effort to build:

  • abuse detection (bot-protection, rate-limiting)
  • password management (password reset, credential stuffing, rotation)
  • data security (encryption/salting, strength validation)

and much more for authentication solutions. It is likely that your application would benefit from leveraging these battle-tested solutions rather than try to rebuild them from scratch.

If you’d still like to build password-based authentication for your application despite these risks, Auth.js gives you full control to do so.

See the callbacks documentation for more information on how to interact with the token. For example, you can add additional information to the token by returning an object from the jwt() callback:

callbacks: {
  async jwt({ token, user, account, profile, isNewUser }) {
    if (user) {
      token.id = user.id
    }
    return token
  }
}

Type parameters

Type parameterValue
CredentialsInputs extends Record<string, CredentialInput>Record<string, CredentialInput>

Parameters

ParameterType
configPartial<CredentialsConfig<CredentialsInputs>>

Returns

CredentialsConfig

Example

import { Auth } from "@auth/core"
import Credentials from "@auth/core/providers/credentials"
 
const request = new Request("https://example.com")
const response = await AuthHandler(request, {
  providers: [
    Credentials({
      credentials: {
        username: { label: "Username" },
        password: {  label: "Password", type: "password" }
      },
      async authorize({ request }) {
        const response = await fetch(request)
        if(!response.ok) return null
        return await response.json() ?? null
      }
    })
  ],
  secret: "...",
  trustHost: true,
})

See

Username/Password Example

Auth.js © Balázs Orbán and Team - 2024