- Notifications
You must be signed in to change notification settings - Fork928
fix: use unique ID for linked accounts#3441
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
35 commits Select commitHold shift + click to select a range
305f696
fix: use unique ID for linked accounts
sreyab4ab301
fixup a bunch of stuff
sreyadd2df9c
gofmt
sreya0356f46
make fake db happy
sreya6b1b900
make audit happy
sreya8f63d5c
fix some tests
sreyade7db33
make gen
sreya5fdf899
fix tests
sreya3a4d049
fmt
sreya4108ece
begin refactoring PR
sreya14b5382
finish migration
sreya8553501
use main sql.dump
sreyaf748d3d
lift error
sreyac1b9871
new migration
sreyae41c103
more rewriting
sreyabb9b777
even more rewriting
sreyad940dae
finish up some test fixing
sreyac97d572
typos
sreya10bfe77
Merge branch 'main' into jon/userauth
sreya28a37f1
fix some remaining tests
sreyac889bf0
fix a gnarly bug
sreya0196a49
add a down migration
sreyab5dc95b
add fkey on user_links, fix tests, add comments
sreyaf2f76e9
add login_type to users table
sreya940ced4
Merge branch 'main' into jon/userauth
sreyaeb266db
fix login_type query
sreya4671bf6
fix tests
sreyac41f4e6
fix audit
sreyaf3d8392
fix down
sreyacc8400b
fix one more test
sreya5c7cbae
Merge branch 'main' into jon/userauth
sreya083d256
pr comments
sreya92c185d
fix conflicting migration file
sreya05595d8
generate.sh
sreyaaa90148
butcher the english language to appease colin
sreyaFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
pr comments
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit083d256c65640d68ae848f2201390f05c9263b0e
There are no files selected for viewing
48 changes: 24 additions & 24 deletionscoderd/database/migrations/000034_linked_user_id.up.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
46 changes: 23 additions & 23 deletionscoderd/database/queries/user_links.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 |
---|---|---|
@@ -1,46 +1,46 @@ | ||
-- name: GetUserLinkByLinkedID :one | ||
SELECT | ||
* | ||
FROM | ||
user_links | ||
WHERE | ||
linked_id = $1; | ||
-- name: GetUserLinkByUserIDLoginType :one | ||
SELECT | ||
* | ||
FROM | ||
user_links | ||
WHERE | ||
user_id = $1 AND login_type = $2; | ||
-- name: InsertUserLink :one | ||
INSERT INTO | ||
user_links ( | ||
user_id, | ||
login_type, | ||
linked_id, | ||
oauth_access_token, | ||
oauth_refresh_token, | ||
oauth_expiry | ||
) | ||
VALUES | ||
( $1, $2, $3, $4, $5, $6 ) RETURNING *; | ||
-- name: UpdateUserLinkedID :one | ||
UPDATE | ||
user_links | ||
SET | ||
linked_id = $1 | ||
WHERE | ||
user_id = $2 AND login_type = $3 RETURNING *; | ||
-- name: UpdateUserLink :one | ||
UPDATE | ||
user_links | ||
SET | ||
oauth_access_token = $1, | ||
oauth_refresh_token = $2, | ||
oauth_expiry = $3 | ||
WHERE | ||
user_id = $4 AND login_type = $5 RETURNING *; |
14 changes: 7 additions & 7 deletionscoderd/database/queries/users.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
8 changes: 5 additions & 3 deletionscoderd/userauth.go
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
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.