Skip to content

Commit f44dc0f

Browse files
authored
Allow shared OAuth account links (#112)
1 parent 6552270 commit f44dc0f

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

app/v1/connections.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,6 @@ func TwitchCallbackGET(md common.MethodData) common.CodeMessager {
207207
}
208208

209209
twitchUser := twitchUserResp.Data[0]
210-
var linkedUserID int
211-
err = md.DB.QueryRow(
212-
"SELECT id FROM users WHERE twitch_account_id = ? AND id != ? LIMIT 1",
213-
twitchUser.ID,
214-
md.ID(),
215-
).Scan(&linkedUserID)
216-
switch {
217-
case err == nil:
218-
return common.SimpleResponse(409, "That Twitch account is already linked to another Akatsuki account.")
219-
case err != sql.ErrNoRows:
220-
md.Err(err)
221-
return Err500
222-
}
223-
224210
_, err = md.DB.Exec(
225211
"UPDATE users SET twitch_account_id = ?, twitch_username = ? WHERE id = ?",
226212
twitchUser.ID,
@@ -340,20 +326,6 @@ func OfficialOsuCallbackGET(md common.MethodData) common.CodeMessager {
340326
return common.SimpleResponse(502, "osu! did not return a user for this OAuth token.")
341327
}
342328

343-
var linkedUserID int
344-
err = md.DB.QueryRow(
345-
"SELECT id FROM users WHERE official_osu_user_id = ? AND id != ? LIMIT 1",
346-
osuUser.ID,
347-
md.ID(),
348-
).Scan(&linkedUserID)
349-
switch {
350-
case err == nil:
351-
return common.SimpleResponse(409, "That official osu! account is already linked to another Akatsuki account.")
352-
case err != sql.ErrNoRows:
353-
md.Err(err)
354-
return Err500
355-
}
356-
357329
_, err = md.DB.Exec(
358330
"UPDATE users SET official_osu_user_id = ?, official_osu_username = ? WHERE id = ?",
359331
osuUser.ID,

0 commit comments

Comments
 (0)