feat(auth): Add login, register, session_info and api creation
This commit is contained in:
14
app/repositories/key.go
Normal file
14
app/repositories/key.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user