Files
NodeBB/public/openapi/write/users/uid/emails.yaml
Barış Soner Uşaklı 8db13d8e86 refactor: how admins change emails (#11973)
* refactor: how admins change emails

ability for admins to change emails from acp
ability for admins to change passwords from acp
only users themselves can use /user/<slug>/edit/email
group actions in manage users dropdown
admins can use the same modal from profile page instead of interstitial to update email
add missing checks to addEmail, if email take throw error
add targetUid to email change event

* test: bunch of baloney

* test: remove old test
2023-08-30 19:29:46 -04:00

87 lines
2.5 KiB
YAML

get:
tags:
- users
summary: get user emails
description: |
This operation lists all emails associated with the user.
This route is accessible to all users if the target user has elected to show their email publicly. Otherwise, it is only accessible to privileged users, or if the calling user is the same as the target user.
parameters:
- in: path
required: true
name: uid
schema:
type: number
description: A valid user id
example: 1
responses:
'200':
description: user emails successfully listed
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../../components/schemas/Status.yaml#/Status
response:
type: object
properties:
emails:
type: array
items:
type: string
description: An email address
post:
tags:
- users
summary: add email to user
description: |
This operation adds an email to the user account, optionally bypassing the confirmation step if requested.
**Note**: The confirmation bypass can only be called by super administrators or users with the `admin:users` privilege.
parameters:
- in: path
name: uid
schema:
type: integer
required: true
description: uid of the account to add the email
example: 1
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
description: A single email address
example: test@example.org
skipConfirmation:
type: boolean
description: If truthy, will automatically confirm the user's email.
example: 1
required:
- email
responses:
'200':
description: email successfully added to user account
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../../components/schemas/Status.yaml#/Status
response:
type: object
properties:
emails:
type: array
items:
type: string
description: An email address
'400':
description: error occured (aka email taken)