tsk-21: Disable registration (#27)

Closes #21

Reviewed-on: phoenix/textsender-auth#27
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-11-27 01:01:32 +00:00
committed by phoenix
parent d01fae0775
commit 9f5029dd6e
26 changed files with 178 additions and 66 deletions
+32 -1
View File
@@ -1,9 +1,40 @@
package handler
import (
"git.kundeng.us/phoenix/textsender-models/pkg/user"
"log"
"os"
"path"
"git.kundeng.us/phoenix/textsender-models/tx0/user"
"github.com/joho/godotenv"
"git.kundeng.us/phoenix/textsender-auth/internal/config"
)
func GetTestUser() user.User {
return user.User{Username: "ghost", PhoneNumber: "+1234567890", Password: "dfgdffddfd"}
}
func GetConfig() *config.Config {
err := godotenv.Load()
if err != nil {
cwd, _ := os.Getwd()
envPath := path.Join(cwd, "../..", ".env")
if err = godotenv.Load(envPath); err != nil {
prevPath := path.Join(envPath, "../..", ".env")
if err = godotenv.Load(prevPath); err != nil {
log.Fatal("Error loading .env file")
}
}
}
unpackedConnString := config.UnpackDBConnString()
dbConnString := unpackedConnString.Parse()
return &config.Config{
DBConnString: dbConnString,
ServerPort: config.Port,
ResetDB: false,
EnableRegistration: config.CheckRegistration(),
}
}