mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
refac: separated api content into sub-packages & renamed usecases
This commit is contained in:
+5
-4
@@ -2,14 +2,15 @@ package test
|
||||
|
||||
import (
|
||||
"GoCMS/adapters/secondary/gateways/models"
|
||||
"GoCMS/api"
|
||||
"GoCMS/api/controllers/auth"
|
||||
"GoCMS/main/server"
|
||||
"github.com/glebarez/sqlite"
|
||||
"gorm.io/gorm"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/glebarez/sqlite"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const testDbFile = "test.db"
|
||||
@@ -45,7 +46,7 @@ func StartServerIfNotAlready() {
|
||||
}
|
||||
|
||||
func getAuthorizationCookie(userId uint32) *http.Cookie {
|
||||
_, tokenString, err := api.TokenAuth.Encode(map[string]interface{}{"user_id": userId})
|
||||
_, tokenString, err := auth.Token.Encode(map[string]interface{}{"user_id": userId})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user