-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor/signup token version] - Signup Token Version사용 #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
43c7173
:sparkles: feat : add version column, used column
ekgns33 e6a5319
:sparkles: feat : remove hard-delete logic
ekgns33 11b4c37
:white_check_mark: test : update test codes
ekgns33 3feb76e
:heavy_plus_sign: chore : add flyway
ekgns33 8aa5977
:hammer: chore : add db-migration files
ekgns33 3880ea0
:recycle: refactor : extract invalidating signup-token
ekgns33 c2e753f
:sparkles: feat : extract signup-token logics to `SignupTokenService`
ekgns33 74d55f1
:white_check_mark: test : add test codes
ekgns33 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| -- V1__Create_baseline.sql | ||
| -- Production baseline - existing schema as of 2025-06-24 | ||
| -- This migration represents the current state of the production database | ||
| -- All existing tables are already present, this is just a baseline marker | ||
|
|
||
| -- Flyway baseline marker for existing production database | ||
| -- No actual schema changes in this file as tables already exist | ||
|
|
||
| -- Existing tables: | ||
| -- - users | ||
| -- - user_token | ||
| -- - user_love_point | ||
| -- - oauth_account | ||
| -- - apple_user_token | ||
| -- - signup_token | ||
| -- - running_record | ||
| -- - item | ||
| -- - egg_type | ||
| -- - item_activity | ||
| -- - user_item | ||
| -- - incubating_egg | ||
| -- - runimo_definition | ||
| -- - runimo | ||
| -- - user_refresh_token | ||
|
|
||
| -- This baseline allows us to start versioned migrations from V2 onwards | ||
| SELECT 'Baseline migration - existing schema marked as V1' as message; |
10 changes: 10 additions & 0 deletions
10
src/main/resources/db/migration/V20250702__add_version_column_signup_token.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ALTER TABLE `signup_token` | ||
| ADD COLUMN `version` BIGINT NOT NULL DEFAULT 0; | ||
|
|
||
| ALTER TABLE `signup_token` | ||
| ADD COLUMN `used` BOOLEAN NOT NULL DEFAULT FALSE; | ||
|
|
||
| -- 기존 토큰들은 사용되지 않은 것으로 처리 | ||
| UPDATE `signup_token` | ||
| SET `used` = FALSE, | ||
| `version` = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix the error code for token reuse scenario.
The
markAsUsed()method throwsSIGNIN_FAIL_ALREADY_EXISTwhich seems inappropriate for a token reuse scenario. Consider using a more specific error code likeTOKEN_ALREADY_USEDorTOKEN_INVALID.public void markAsUsed() { if (this.used) { - throw new SignUpException(UserHttpResponseCode.SIGNIN_FAIL_ALREADY_EXIST); + throw new SignUpException(UserHttpResponseCode.TOKEN_INVALID); } this.used = true; }📝 Committable suggestion
🤖 Prompt for AI Agents