replace static secrets with enviroment variables
This commit is contained in:
@@ -16,6 +16,10 @@ import (
|
||||
)
|
||||
|
||||
func TestDatabase(t *testing.T) {
|
||||
// set enviroment variables
|
||||
os.Setenv("ACCESS_SECRET", "12345678910111213141516171819202")
|
||||
os.Setenv("REFRESH_SECRET", "9998979695949392919089888786858")
|
||||
|
||||
dbName := "user.db"
|
||||
if _, err := os.Stat(dbName); err == nil {
|
||||
t.Log("remove user.db to start test with empty database")
|
||||
@@ -154,6 +158,9 @@ func TestDatabase(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLoginAndAuthorization(t *testing.T) {
|
||||
os.Setenv("ACCESS_SECRET", "12345678910111213141516171819202")
|
||||
os.Setenv("REFRESH_SECRET", "9998979695949392919089888786858")
|
||||
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
// Setup your AccessHandler and router
|
||||
|
||||
Reference in New Issue
Block a user