diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-28 00:57:07 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-28 00:57:07 +0900 |
| commit | ab2a49654a7964bf9e6222b17676ca87588b88d8 (patch) | |
| tree | 4674b807c4e32efd9919e6ab90019e5b68a84d19 /backend/auth/auth.go | |
| parent | b70fa3abf9c96871cc3e39090e9a00da4ad87b8b (diff) | |
| parent | 519008c4bae3db046004e4bc2aaa23a2e66311c7 (diff) | |
| download | phperkaigi-2025-albatross-ab2a49654a7964bf9e6222b17676ca87588b88d8.tar.gz phperkaigi-2025-albatross-ab2a49654a7964bf9e6222b17676ca87588b88d8.tar.zst phperkaigi-2025-albatross-ab2a49654a7964bf9e6222b17676ca87588b88d8.zip | |
Merge branch 'auth'
Diffstat (limited to 'backend/auth/auth.go')
| -rw-r--r-- | backend/auth/auth.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/backend/auth/auth.go b/backend/auth/auth.go new file mode 100644 index 0000000..40e54a6 --- /dev/null +++ b/backend/auth/auth.go @@ -0,0 +1,19 @@ +package auth + +import ( + "context" + "fmt" + + "github.com/nsfisis/iosdc-2024-albatross-backend/db" +) + +func Login(ctx context.Context, queries *db.Queries, username, password string) (int, error) { + userAuth, err := queries.GetUserAuthByUsername(ctx, username) + if err != nil { + return 0, err + } + if userAuth.AuthType == "bypass" { + return int(userAuth.UserID), nil + } + return 0, fmt.Errorf("not implemented") +} |
