aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/auth.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-22 04:36:45 +0900
committernsfisis <nsfisis@gmail.com>2024-07-22 04:36:53 +0900
commita4685927a1f7fe8374a567ee74cc62aad639f4c3 (patch)
tree1eaf5845965c4d5d2db4faf9582c17444a762ffd /backend/auth.go
parent2512da7ca57dc4c52900417a50daf4f6f2f74054 (diff)
downloadiosdc-japan-2024-albatross-a4685927a1f7fe8374a567ee74cc62aad639f4c3.tar.gz
iosdc-japan-2024-albatross-a4685927a1f7fe8374a567ee74cc62aad639f4c3.tar.zst
iosdc-japan-2024-albatross-a4685927a1f7fe8374a567ee74cc62aad639f4c3.zip
user login
Diffstat (limited to 'backend/auth.go')
-rw-r--r--backend/auth.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/backend/auth.go b/backend/auth.go
new file mode 100644
index 0000000..f27b8c0
--- /dev/null
+++ b/backend/auth.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+ "context"
+ "fmt"
+
+ "iosdc-code-battle-poc/db"
+)
+
+func authLogin(ctx context.Context, queries *db.Queries, username, password string) (int, error) {
+ userAuth, err := queries.GetUserAuthFromUsername(ctx, username)
+ if err != nil {
+ return 0, err
+ }
+ if userAuth.AuthType == "bypass" {
+ return int(userAuth.UserID), nil
+ }
+ return 0, fmt.Errorf("not implemented")
+}