aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/auth/auth.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-17 21:11:07 +0900
committernsfisis <nsfisis@gmail.com>2024-08-17 21:11:07 +0900
commit01d3120fd7129f573d88f7aa7c227b3ef93fe368 (patch)
treeeea4f5ac0f025c7bdbff71d2ee83b4dce99355ef /backend/auth/auth.go
parentf926ef682de637b717d3b0cc0eaee43c59e83c95 (diff)
parentb923a9d6534820d33f42bc65c47ae22889bde922 (diff)
downloadphperkaigi-2025-albatross-01d3120fd7129f573d88f7aa7c227b3ef93fe368.tar.gz
phperkaigi-2025-albatross-01d3120fd7129f573d88f7aa7c227b3ef93fe368.tar.zst
phperkaigi-2025-albatross-01d3120fd7129f573d88f7aa7c227b3ef93fe368.zip
Merge branch 'feat/icon'
Diffstat (limited to 'backend/auth/auth.go')
-rw-r--r--backend/auth/auth.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/backend/auth/auth.go b/backend/auth/auth.go
index 0e55d8d..2266c50 100644
--- a/backend/auth/auth.go
+++ b/backend/auth/auth.go
@@ -3,13 +3,15 @@ package auth
import (
"context"
"errors"
+ "log"
"time"
"github.com/jackc/pgx/v5"
"golang.org/x/crypto/bcrypt"
- "github.com/nsfisis/iosdc-japan-2024-albatross/backend/auth/fortee"
+ "github.com/nsfisis/iosdc-japan-2024-albatross/backend/account"
"github.com/nsfisis/iosdc-japan-2024-albatross/backend/db"
+ "github.com/nsfisis/iosdc-japan-2024-albatross/backend/fortee"
)
var (
@@ -98,6 +100,13 @@ func signup(
}); err != nil {
return 0, err
}
+ go func() {
+ err := account.FetchIcon(context.Background(), queries, int(userID))
+ if err != nil {
+ log.Printf("%v", err)
+ // The failure is intentionally ignored. Retry manually if needed.
+ }
+ }()
return int(userID), nil
}
@@ -119,7 +128,7 @@ func verifyForteeAccount(ctx context.Context, username string, password string)
ctx, cancel := context.WithTimeout(ctx, forteeAPITimeout)
defer cancel()
- canonicalizedUsername, err := fortee.LoginFortee(ctx, username, password)
+ canonicalizedUsername, err := fortee.Login(ctx, username, password)
if errors.Is(err, context.DeadlineExceeded) {
return "", ErrForteeLoginTimeout
}