mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-05-01 07:00:13 -05:00
feat(dashboard): improve dashboard settings for user and tokens (#275)
* feat: expires at as Date * wip: change passwords * feat: user can change their password * chore: cleanup * chore: linting * chore: fix build issue * fix: protoc version * chore: resolve feedback * fix: ref * fix: password inputs * chore: update generated * fix: update respository * feat: only show change password if user has password * fix: linting * fix: validation string * chore: regen api --------- Co-authored-by: gabriel ruttner <gabe@hatchet.run>
This commit is contained in:
@@ -20,6 +20,8 @@ UserTenantPublic:
|
||||
$ref: "./user.yaml#/UserTenantPublic"
|
||||
UserLoginRequest:
|
||||
$ref: "./user.yaml#/UserLoginRequest"
|
||||
UserChangePasswordRequest:
|
||||
$ref: "./user.yaml#/UserChangePasswordRequest"
|
||||
UserRegisterRequest:
|
||||
$ref: "./user.yaml#/UserRegisterRequest"
|
||||
UserTenantMembershipsList:
|
||||
|
||||
@@ -12,6 +12,9 @@ User:
|
||||
emailVerified:
|
||||
type: boolean
|
||||
description: Whether the user has verified their email address.
|
||||
hasPassword:
|
||||
type: boolean
|
||||
description: Whether the user has a password set.
|
||||
required:
|
||||
- metadata
|
||||
- email
|
||||
@@ -49,6 +52,23 @@ UserLoginRequest:
|
||||
- password
|
||||
type: object
|
||||
|
||||
UserChangePasswordRequest:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
description: The password of the user.
|
||||
x-oapi-codegen-extra-tags:
|
||||
validate: "required,password"
|
||||
newPassword:
|
||||
type: string
|
||||
description: The new password for the user.
|
||||
x-oapi-codegen-extra-tags:
|
||||
validate: "required,password"
|
||||
required:
|
||||
- password
|
||||
- newPassword
|
||||
type: object
|
||||
|
||||
UserRegisterRequest:
|
||||
properties:
|
||||
name:
|
||||
|
||||
@@ -50,6 +50,8 @@ paths:
|
||||
$ref: "./paths/ingestors/ingestors.yaml#/deleteSNS"
|
||||
/api/v1/users/current:
|
||||
$ref: "./paths/user/user.yaml#/current"
|
||||
/api/v1/users/password:
|
||||
$ref: "./paths/user/user.yaml#/update-password"
|
||||
/api/v1/users/register:
|
||||
$ref: "./paths/user/user.yaml#/register"
|
||||
/api/v1/users/logout:
|
||||
|
||||
@@ -36,6 +36,45 @@ login:
|
||||
summary: Login user
|
||||
tags:
|
||||
- User
|
||||
update-password:
|
||||
post:
|
||||
description: Update a user password.
|
||||
operationId: user:update:password
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../../components/schemas/_index.yaml#/UserChangePasswordRequest"
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../../components/schemas/_index.yaml#/User"
|
||||
description: Successfully changed password
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../../components/schemas/_index.yaml#/APIErrors"
|
||||
description: A malformed or bad request
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../../components/schemas/_index.yaml#/APIErrors"
|
||||
description: Unauthorized
|
||||
"405":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../../components/schemas/_index.yaml#/APIErrors"
|
||||
description: Method not allowed
|
||||
security:
|
||||
- cookieAuth: []
|
||||
summary: Change user password
|
||||
tags:
|
||||
- User
|
||||
current:
|
||||
get:
|
||||
description: Gets the current user
|
||||
|
||||
Reference in New Issue
Block a user