Skip to content

Commit 1864965

Browse files
Feature: User email change flow (#717)
* Add request email change button to profile form * Add change email page to UI
1 parent 931b9d9 commit 1864965

17 files changed

+1030
-9
lines changed

docs/swagger/docs.go

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9573,6 +9573,126 @@ const docTemplate = `{
95739573
}
95749574
}
95759575
},
9576+
"/user/{userId}/email-change": {
9577+
"post": {
9578+
"security": [
9579+
{
9580+
"ApiKeyAuth": []
9581+
}
9582+
],
9583+
"description": "Sends a change email request Email to user",
9584+
"produces": [
9585+
"application/json"
9586+
],
9587+
"tags": [
9588+
"auth"
9589+
],
9590+
"summary": "Change Email Request",
9591+
"parameters": [
9592+
{
9593+
"type": "string",
9594+
"description": "the user ID",
9595+
"name": "userId",
9596+
"in": "path",
9597+
"required": true
9598+
}
9599+
],
9600+
"responses": {
9601+
"200": {
9602+
"description": "OK",
9603+
"schema": {
9604+
"$ref": "#/definitions/http.standardJsonResponse"
9605+
}
9606+
},
9607+
"403": {
9608+
"description": "Forbidden",
9609+
"schema": {
9610+
"$ref": "#/definitions/http.standardJsonResponse"
9611+
}
9612+
},
9613+
"500": {
9614+
"description": "Internal Server Error",
9615+
"schema": {
9616+
"$ref": "#/definitions/http.standardJsonResponse"
9617+
}
9618+
}
9619+
}
9620+
}
9621+
},
9622+
"/user/{userId}/email-change/{changeId}": {
9623+
"post": {
9624+
"security": [
9625+
{
9626+
"ApiKeyAuth": []
9627+
}
9628+
],
9629+
"description": "Attempts to change the users email\nRequires a valid change ID",
9630+
"produces": [
9631+
"application/json"
9632+
],
9633+
"tags": [
9634+
"auth"
9635+
],
9636+
"summary": "Change Email Action",
9637+
"parameters": [
9638+
{
9639+
"type": "string",
9640+
"description": "the user ID",
9641+
"name": "userId",
9642+
"in": "path",
9643+
"required": true
9644+
},
9645+
{
9646+
"type": "string",
9647+
"description": "the change ID",
9648+
"name": "changeId",
9649+
"in": "path",
9650+
"required": true
9651+
},
9652+
{
9653+
"description": "the user object to update",
9654+
"name": "user",
9655+
"in": "body",
9656+
"required": true,
9657+
"schema": {
9658+
"$ref": "#/definitions/http.changeEmailRequestBody"
9659+
}
9660+
}
9661+
],
9662+
"responses": {
9663+
"200": {
9664+
"description": "OK",
9665+
"schema": {
9666+
"allOf": [
9667+
{
9668+
"$ref": "#/definitions/http.standardJsonResponse"
9669+
},
9670+
{
9671+
"type": "object",
9672+
"properties": {
9673+
"data": {
9674+
"$ref": "#/definitions/thunderdome.User"
9675+
}
9676+
}
9677+
}
9678+
]
9679+
}
9680+
},
9681+
"403": {
9682+
"description": "Forbidden",
9683+
"schema": {
9684+
"$ref": "#/definitions/http.standardJsonResponse"
9685+
}
9686+
},
9687+
"500": {
9688+
"description": "Internal Server Error",
9689+
"schema": {
9690+
"$ref": "#/definitions/http.standardJsonResponse"
9691+
}
9692+
}
9693+
}
9694+
}
9695+
},
95769696
"/users/{userId}": {
95779697
"get": {
95789698
"security": [
@@ -12029,6 +12149,17 @@ const docTemplate = `{
1202912149
}
1203012150
}
1203112151
},
12152+
"http.changeEmailRequestBody": {
12153+
"type": "object",
12154+
"required": [
12155+
"email"
12156+
],
12157+
"properties": {
12158+
"email": {
12159+
"type": "string"
12160+
}
12161+
}
12162+
},
1203212163
"http.checkinCommentRequestBody": {
1203312164
"type": "object",
1203412165
"required": [

docs/swagger/swagger.json

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9565,6 +9565,126 @@
95659565
}
95669566
}
95679567
},
9568+
"/user/{userId}/email-change": {
9569+
"post": {
9570+
"security": [
9571+
{
9572+
"ApiKeyAuth": []
9573+
}
9574+
],
9575+
"description": "Sends a change email request Email to user",
9576+
"produces": [
9577+
"application/json"
9578+
],
9579+
"tags": [
9580+
"auth"
9581+
],
9582+
"summary": "Change Email Request",
9583+
"parameters": [
9584+
{
9585+
"type": "string",
9586+
"description": "the user ID",
9587+
"name": "userId",
9588+
"in": "path",
9589+
"required": true
9590+
}
9591+
],
9592+
"responses": {
9593+
"200": {
9594+
"description": "OK",
9595+
"schema": {
9596+
"$ref": "#/definitions/http.standardJsonResponse"
9597+
}
9598+
},
9599+
"403": {
9600+
"description": "Forbidden",
9601+
"schema": {
9602+
"$ref": "#/definitions/http.standardJsonResponse"
9603+
}
9604+
},
9605+
"500": {
9606+
"description": "Internal Server Error",
9607+
"schema": {
9608+
"$ref": "#/definitions/http.standardJsonResponse"
9609+
}
9610+
}
9611+
}
9612+
}
9613+
},
9614+
"/user/{userId}/email-change/{changeId}": {
9615+
"post": {
9616+
"security": [
9617+
{
9618+
"ApiKeyAuth": []
9619+
}
9620+
],
9621+
"description": "Attempts to change the users email\nRequires a valid change ID",
9622+
"produces": [
9623+
"application/json"
9624+
],
9625+
"tags": [
9626+
"auth"
9627+
],
9628+
"summary": "Change Email Action",
9629+
"parameters": [
9630+
{
9631+
"type": "string",
9632+
"description": "the user ID",
9633+
"name": "userId",
9634+
"in": "path",
9635+
"required": true
9636+
},
9637+
{
9638+
"type": "string",
9639+
"description": "the change ID",
9640+
"name": "changeId",
9641+
"in": "path",
9642+
"required": true
9643+
},
9644+
{
9645+
"description": "the user object to update",
9646+
"name": "user",
9647+
"in": "body",
9648+
"required": true,
9649+
"schema": {
9650+
"$ref": "#/definitions/http.changeEmailRequestBody"
9651+
}
9652+
}
9653+
],
9654+
"responses": {
9655+
"200": {
9656+
"description": "OK",
9657+
"schema": {
9658+
"allOf": [
9659+
{
9660+
"$ref": "#/definitions/http.standardJsonResponse"
9661+
},
9662+
{
9663+
"type": "object",
9664+
"properties": {
9665+
"data": {
9666+
"$ref": "#/definitions/thunderdome.User"
9667+
}
9668+
}
9669+
}
9670+
]
9671+
}
9672+
},
9673+
"403": {
9674+
"description": "Forbidden",
9675+
"schema": {
9676+
"$ref": "#/definitions/http.standardJsonResponse"
9677+
}
9678+
},
9679+
"500": {
9680+
"description": "Internal Server Error",
9681+
"schema": {
9682+
"$ref": "#/definitions/http.standardJsonResponse"
9683+
}
9684+
}
9685+
}
9686+
}
9687+
},
95689688
"/users/{userId}": {
95699689
"get": {
95709690
"security": [
@@ -12021,6 +12141,17 @@
1202112141
}
1202212142
}
1202312143
},
12144+
"http.changeEmailRequestBody": {
12145+
"type": "object",
12146+
"required": [
12147+
"email"
12148+
],
12149+
"properties": {
12150+
"email": {
12151+
"type": "string"
12152+
}
12153+
}
12154+
},
1202412155
"http.checkinCommentRequestBody": {
1202512156
"type": "object",
1202612157
"required": [

docs/swagger/swagger.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ definitions:
118118
- pointAverageRounding
119119
- pointValuesAllowed
120120
type: object
121+
http.changeEmailRequestBody:
122+
properties:
123+
email:
124+
type: string
125+
required:
126+
- email
127+
type: object
121128
http.checkinCommentRequestBody:
122129
properties:
123130
comment:
@@ -7972,6 +7979,82 @@ paths:
79727979
summary: Create Storyboard
79737980
tags:
79747981
- storyboard
7982+
/user/{userId}/email-change:
7983+
post:
7984+
description: Sends a change email request Email to user
7985+
parameters:
7986+
- description: the user ID
7987+
in: path
7988+
name: userId
7989+
required: true
7990+
type: string
7991+
produces:
7992+
- application/json
7993+
responses:
7994+
"200":
7995+
description: OK
7996+
schema:
7997+
$ref: '#/definitions/http.standardJsonResponse'
7998+
"403":
7999+
description: Forbidden
8000+
schema:
8001+
$ref: '#/definitions/http.standardJsonResponse'
8002+
"500":
8003+
description: Internal Server Error
8004+
schema:
8005+
$ref: '#/definitions/http.standardJsonResponse'
8006+
security:
8007+
- ApiKeyAuth: []
8008+
summary: Change Email Request
8009+
tags:
8010+
- auth
8011+
/user/{userId}/email-change/{changeId}:
8012+
post:
8013+
description: |-
8014+
Attempts to change the users email
8015+
Requires a valid change ID
8016+
parameters:
8017+
- description: the user ID
8018+
in: path
8019+
name: userId
8020+
required: true
8021+
type: string
8022+
- description: the change ID
8023+
in: path
8024+
name: changeId
8025+
required: true
8026+
type: string
8027+
- description: the user object to update
8028+
in: body
8029+
name: user
8030+
required: true
8031+
schema:
8032+
$ref: '#/definitions/http.changeEmailRequestBody'
8033+
produces:
8034+
- application/json
8035+
responses:
8036+
"200":
8037+
description: OK
8038+
schema:
8039+
allOf:
8040+
- $ref: '#/definitions/http.standardJsonResponse'
8041+
- properties:
8042+
data:
8043+
$ref: '#/definitions/thunderdome.User'
8044+
type: object
8045+
"403":
8046+
description: Forbidden
8047+
schema:
8048+
$ref: '#/definitions/http.standardJsonResponse'
8049+
"500":
8050+
description: Internal Server Error
8051+
schema:
8052+
$ref: '#/definitions/http.standardJsonResponse'
8053+
security:
8054+
- ApiKeyAuth: []
8055+
summary: Change Email Action
8056+
tags:
8057+
- auth
79758058
/users/{userId}:
79768059
delete:
79778060
description: Deletes a user

0 commit comments

Comments
 (0)