mirror of
https://github.com/directus/directus.git
synced 2026-02-02 09:34:54 -05:00
Merge branch 'main' into insights
This commit is contained in:
@@ -819,7 +819,7 @@ mutation {
|
||||
|
||||
---
|
||||
|
||||
## Enable Two-Factor Authentication
|
||||
## Generate Two-Factor Authentication Secret
|
||||
|
||||
Generates a secret and returns the URL to be used in an authenticator app.
|
||||
|
||||
@@ -853,13 +853,13 @@ OTP secret to be saved in the authenticator app.
|
||||
### REST API
|
||||
|
||||
```
|
||||
POST /users/me/tfa/enable
|
||||
POST /users/me/tfa/generate
|
||||
```
|
||||
|
||||
##### Example
|
||||
|
||||
```json
|
||||
// POST /users/me/tfa/enable
|
||||
// POST /users/me/tfa/generate
|
||||
{
|
||||
"password": "d1r3ctu5"
|
||||
}
|
||||
@@ -873,7 +873,7 @@ POST /graphql/system
|
||||
|
||||
```graphql
|
||||
type Mutation {
|
||||
users_me_tfa_enable(password: String!): users_me_tfa_enable_data
|
||||
users_me_tfa_generate(password: String!): users_me_tfa_generate_data
|
||||
}
|
||||
```
|
||||
|
||||
@@ -881,7 +881,7 @@ type Mutation {
|
||||
|
||||
```graphql
|
||||
mutation {
|
||||
users_me_tfa_enable(password: "d1r3ctu5") {
|
||||
users_me_tfa_generate(password: "d1r3ctu5") {
|
||||
secret
|
||||
otpauth_url
|
||||
}
|
||||
@@ -893,6 +893,77 @@ mutation {
|
||||
|
||||
---
|
||||
|
||||
## Enable Two-Factor Authentication
|
||||
|
||||
Adds a TFA secret to the user account.
|
||||
|
||||
<div class="two-up">
|
||||
<div class="left">
|
||||
|
||||
### Request Body
|
||||
|
||||
<div class="definitions">
|
||||
|
||||
`secret` **Required**\
|
||||
The TFA secret from tfa/generate.
|
||||
|
||||
`otp` **Required**\
|
||||
OTP generated with the secret, to recheck if the user has a correct TFA setup
|
||||
|
||||
</div>
|
||||
|
||||
### Returns
|
||||
|
||||
<div class="definitions">
|
||||
|
||||
Empty response.
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="right">
|
||||
|
||||
### REST API
|
||||
|
||||
```
|
||||
POST /users/me/tfa/enable
|
||||
```
|
||||
|
||||
##### Example
|
||||
|
||||
```json
|
||||
// POST /users/me/tfa/enable
|
||||
{
|
||||
"otp": "123456",
|
||||
"secret": "3CtiutsNBmY3szHE"
|
||||
}
|
||||
```
|
||||
|
||||
### GraphQL
|
||||
|
||||
```
|
||||
POST /graphql/system
|
||||
```
|
||||
|
||||
```graphql
|
||||
type Mutation {
|
||||
users_me_tfa_enable(otp: String!, secret: String!): Boolean
|
||||
}
|
||||
```
|
||||
|
||||
##### Example
|
||||
|
||||
```graphql
|
||||
mutation {
|
||||
users_me_tfa_enable(otp: "123456", secret: "3CtiutsNBmY3szHE")
|
||||
}
|
||||
```
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## Disable Two-Factor Authentication
|
||||
|
||||
Disables two-factor authentication by removing the OTP secret from the user.
|
||||
|
||||
Reference in New Issue
Block a user