Skip to content

Commit c5dad66

Browse files
committed
openapi and docs
1 parent 9fae869 commit c5dad66

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

backend/spring-boot/src/main/resources/static/openapi.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,13 +828,12 @@ components:
828828
properties:
829829
token:
830830
type: string
831-
format: JWT
832831
password:
833832
type: string
834833
confirmPassword:
835834
type: string
836835
example:
837-
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJyb2xlcyI6WyJVU0VSIl0sImlzc3VlZEF0IjoiMjAyMS0xMC0yMFQxNDozMzo0NC43MDcyOTMzMDlaIiwiZXhwIjoxNjM0NzQxMzI0LCJ1c2VySWQiOjJ9.uXOVA1q-o2DtHmwBAzEfqEm8GLpAhXrYo0rlZ_6NFbBGILhkV74x-Iu9W2uSfSlwp1IfKPCHlR6zWVPvAbhWVw
836+
token: 550e8400-e29b-41d4-a716-446655440000
838837
password: qwerty321
839838
confirmPassword: qwerty321
840839
VerificationEmailRequest:
@@ -863,9 +862,8 @@ components:
863862
properties:
864863
token:
865864
type: string
866-
format: JWT
867865
example:
868-
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJyb2xlcyI6WyJVU0VSIl0sImlzc3VlZEF0IjoiMjAyMS0xMC0yMFQxNDozMzo0NC43MDcyOTMzMDlaIiwiZXhwIjoxNjM0NzQxMzI0LCJ1c2VySWQiOjJ9.uXOVA1q-o2DtHmwBAzEfqEm8GLpAhXrYo0rlZ_6NFbBGILhkV74x-Iu9W2uSfSlwp1IfKPCHlR6zWVPvAbhWVw
866+
token: 550e8400-e29b-41d4-a716-446655440000
869867
PatchProfileRequest:
870868
description: Patch profile request
871869
required: true

docs/src/content/how-it-works/auth.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,19 @@ Users can sign in with their Google account as an alternative to email/password
107107

108108
### Account Verification
109109

110-
When a user signs up, a JWT with the purpose `verify_email_token` is created and sent to the user via email as part of a verification link.
110+
When a user signs up, a random opaque token (UUID) is generated and stored in Redis alongside the user's ID. The token is sent to the user via email as part of a verification link. When the user clicks the link, the token is looked up in Redis to identify the user, then immediately deleted (one-time use). The token automatically expires via Redis TTL if unused.
111111

112112
### Password Reset
113113

114-
When a user requests a password reset, a JWT with the purpose `reset_password` is generated and sent to the user via email as part of a reset link.
114+
When a user requests a password reset, a random opaque token (UUID) is generated and stored in Redis alongside the user's ID. The token is sent to the user via email as part of a reset link. When the user submits a new password with the token, it is looked up in Redis, then immediately deleted (one-time use). The token automatically expires via Redis TTL if unused.
115115

116116
### JWT Structure
117117

118-
All JWTs share the following structure:
118+
Access and refresh tokens are JWTs with the following structure:
119119

120120
- **issuer**: ID of a user who created the token.
121121
- **issuedAt**: Timestamp of when the token was created.
122122
- **expireAt**: Timestamp of when the token expires.
123-
- **purpose**: Describes the token's purpose (`access_token`, `refresh_token`, `reset_password_token`, `verify_email_token`).
124-
125-
Access and refresh tokens include additional claims:
126-
123+
- **purpose**: Describes the token's purpose (`access_token`, `refresh_token`).
127124
- **roles**: Represents the roles assigned to the user.
128125
- **deviceId**: Identifies the device/session the token belongs to.

0 commit comments

Comments
 (0)