feat(auth): Add login, register, session_info and api creation

This commit is contained in:
Björn Benouarets
2026-01-15 20:25:17 +01:00
commit 13d908420a
31 changed files with 1421 additions and 0 deletions

14
app/repositories/key.go Normal file
View File

@@ -0,0 +1,14 @@
package repositories
import (
"git.secnex.io/secnex/auth-api/database"
"git.secnex.io/secnex/auth-api/models"
)
func GetApiKey(id string) (*models.ApiKey, error) {
var apiKey *models.ApiKey
if err := database.DB.Where("id = ? AND deleted_at IS NULL AND enabled = true", id).First(&apiKey).Error; err != nil {
return nil, err
}
return apiKey, nil
}