big ole refactor
This commit is contained in:
@@ -22,7 +22,7 @@ import (
|
||||
func Callback(
|
||||
s *hws.Server,
|
||||
auth *hwsauth.Authenticator[*db.User, bun.Tx],
|
||||
conn *bun.DB,
|
||||
conn *db.DB,
|
||||
cfg *config.Config,
|
||||
store *store.Store,
|
||||
discordAPI *discord.APIClient,
|
||||
@@ -70,7 +70,7 @@ func Callback(
|
||||
switch data {
|
||||
case "login":
|
||||
var redirect func()
|
||||
if ok := db.WithWriteTx(s, w, r, conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
if ok := conn.WithWriteTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
redirect, err = login(ctx, auth, tx, cfg, w, r, code, store, discordAPI)
|
||||
if err != nil {
|
||||
throw.InternalServiceError(s, w, r, "OAuth login failed", err)
|
||||
|
||||
Reference in New Issue
Block a user