move link in activation and password reset emails into login-server config

This commit is contained in:
einhornimmond 2021-03-24 19:18:39 +01:00
parent a57be58197
commit cb0b3ef90e
4 changed files with 11 additions and 3 deletions

View File

@ -22,6 +22,8 @@ loginServer.db.user = root
loginServer.db.password = loginServer.db.password =
loginServer.db.port = 3306 loginServer.db.port = 3306
frontend.checkEmailPath = http://localhost/account/checkEmail
email.disable = true email.disable = true
#email.username = #email.username =
#email.sender = #email.sender =

View File

@ -48,6 +48,7 @@ namespace ServerConfig {
Languages g_default_locale; Languages g_default_locale;
std::string g_php_serverPath; std::string g_php_serverPath;
std::string g_php_serverHost; std::string g_php_serverHost;
std::string g_frontend_checkEmailPath;
int g_phpServerPort; int g_phpServerPort;
Poco::Mutex g_TimeMutex; Poco::Mutex g_TimeMutex;
int g_FakeLoginSleepTime = 820; int g_FakeLoginSleepTime = 820;
@ -210,7 +211,7 @@ namespace ServerConfig {
DISASM_FALSERET; DISASM_FALSERET;
g_SessionTimeout = cfg.getInt("session.timeout", SESSION_TIMEOUT_DEFAULT); g_SessionTimeout = cfg.getInt("session.timeout", SESSION_TIMEOUT_DEFAULT);
g_serverPath = cfg.getString("loginServer.path", ""); g_serverPath = cfg.getString("loginServer.path", "http://localhost/account");
replaceZeroIPWithLocalhostIP(g_serverPath); replaceZeroIPWithLocalhostIP(g_serverPath);
g_default_locale = LanguageManager::languageFromString(cfg.getString("loginServer.default_locale")); g_default_locale = LanguageManager::languageFromString(cfg.getString("loginServer.default_locale"));
g_serverPort = cfg.getInt("loginServer.port", 0); g_serverPort = cfg.getInt("loginServer.port", 0);
@ -231,6 +232,8 @@ namespace ServerConfig {
if ("" != app_secret_string) { if ("" != app_secret_string) {
g_CryptoAppSecret = DataTypeConverter::hexToBin(app_secret_string); g_CryptoAppSecret = DataTypeConverter::hexToBin(app_secret_string);
} }
std::string defaultCheckEmailPath = g_serverPath + "/checkEmail";
g_frontend_checkEmailPath = cfg.getString("frontend.checkEmailPath", defaultCheckEmailPath);
//g_CryptoAppSecret //g_CryptoAppSecret
g_gRPCRelayServerFullURL = cfg.getString("grpc.server", ""); g_gRPCRelayServerFullURL = cfg.getString("grpc.server", "");

View File

@ -66,6 +66,7 @@ namespace ServerConfig {
extern Languages g_default_locale; extern Languages g_default_locale;
extern std::string g_php_serverPath; extern std::string g_php_serverPath;
extern std::string g_php_serverHost; extern std::string g_php_serverHost;
extern std::string g_frontend_checkEmailPath;
extern int g_phpServerPort; extern int g_phpServerPort;
extern Poco::Mutex g_TimeMutex; extern Poco::Mutex g_TimeMutex;
extern int g_FakeLoginSleepTime; extern int g_FakeLoginSleepTime;

View File

@ -120,8 +120,10 @@ namespace controller {
std::string EmailVerificationCode::getLink() std::string EmailVerificationCode::getLink()
{ {
std::string link = ServerConfig::g_serverPath; std::string link = ServerConfig::g_frontend_checkEmailPath;
link += "/checkEmail/"; if (link.data()[link.size() - 1] != '/') {
link += '/';
}
link += std::to_string(getModel()->getCode()); link += std::to_string(getModel()->getCode());
return link; return link;
} }