Credential.create()
Learn: Credentials |
---|
Create a credential.
Signature
Credential.create(data: { id: ID | Null, document: Ref<{ *: Any }>, password: String | Null, data: { *: Any } | Null }) => Credential
Description
Creates a credential with the
provided document fields. Fauna stores credentials as documents in the
Credential
system collection.
A credential associates a password with an
identity document. You can
use credentials and the credential.login()
method to
create tokens as part of an
end-user authentication system.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data |
true |
Document fields for the new
For supported document fields, see
|
Return value
Type | Description |
---|---|
The new |