Fixing ActionLinks

This commit is contained in:
stephb9959
2021-11-09 13:41:28 -08:00
parent c0ef77eb53
commit 7636568fb4
6 changed files with 6 additions and 8 deletions

2
build
View File

@@ -1 +1 @@
13
15

View File

@@ -48,7 +48,7 @@ namespace OpenWifi {
StorageService()->SentAction(i.id);
} else if (i.action==OpenWifi::SecurityObjects::LinkActions::VERIFY_EMAIL) {
if(AuthService::SendEmailToUser(i.id, i.userId, AuthService::EMAIL_VERIFICATION)) {
Logger_.information(Poco::format("Send password reset link to %s",i.userId));
Logger_.information(Poco::format("Send email verification link to %s",i.userId));
}
StorageService()->SentAction(i.id);
} else {

View File

@@ -359,7 +359,7 @@ namespace OpenWifi {
A.id = MicroService::instance().CreateUUID();
A.created = std::time(nullptr);
A.expires = A.created + 24*60*60;
Storage().CreateAction(A);
StorageService()->CreateAction(A);
UInfo.waitingForEmailCheck = true;
return true;
}

View File

@@ -18,7 +18,7 @@ namespace OpenWifi {
auto Id = GetParameter("id","");
SecurityObjects::ActionLink Link;
if(!Storage().GetActionLink(Id,Link))
if(!StorageService()->GetActionLink(Id,Link))
return DoReturnA404();
if(Action=="password_reset")
@@ -34,7 +34,7 @@ namespace OpenWifi {
auto Id = GetParameter("id","");
SecurityObjects::ActionLink Link;
if(!Storage().GetActionLink(Id,Link))
if(!StorageService()->GetActionLink(Id,Link))
return DoReturnA404();
Logger_.information(Poco::format("COMPLETE-PASSWORD-RESET(%s): For ID=%s", Request->clientAddress().toString(), Link.userId));

View File

@@ -73,7 +73,7 @@ namespace OpenWifi {
NewLink.userId = userId;
NewLink.created = std::time(nullptr);
NewLink.expires = NewLink.created + (24*60*60);
Storage().CreateAction(NewLink);
StorageService()->CreateAction(NewLink);
Poco::JSON::Object ReturnObj;
SecurityObjects::UserInfoAndPolicy UInfo;

View File

@@ -103,8 +103,6 @@ namespace OpenWifi {
DBType dbType_ = sqlite;
};
// inline StorageClass * Storage() { return StorageClass::instance(); }
#ifdef SMALL_BUILD
int Service::Setup_MySQL() { Daemon()->exit(Poco::Util::Application::EXIT_CONFIG); return 0; }
int Service::Setup_PostgreSQL() { Daemon()->exit(Poco::Util::Application::EXIT_CONFIG); return 0; }