mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-01 03:07:59 +00:00
Adding Authenticator doc.
This commit is contained in:
@@ -71,34 +71,23 @@ namespace OpenWifi {
|
|||||||
|
|
||||||
inline bool StartValidation(const SecurityObjects::UserInfo &User, bool Subscriber, std::string & QRCode, bool Reset) {
|
inline bool StartValidation(const SecurityObjects::UserInfo &User, bool Subscriber, std::string & QRCode, bool Reset) {
|
||||||
auto Hint = Cache_.find(User.id);
|
auto Hint = Cache_.find(User.id);
|
||||||
_OWDEBUG_
|
|
||||||
if(Hint!=Cache_.end() && Hint->second.Subscriber==Subscriber) {
|
if(Hint!=Cache_.end() && Hint->second.Subscriber==Subscriber) {
|
||||||
_OWDEBUG_
|
|
||||||
if(Reset) {
|
if(Reset) {
|
||||||
_OWDEBUG_
|
|
||||||
Hint->second.Subscriber = Subscriber;
|
Hint->second.Subscriber = Subscriber;
|
||||||
Hint->second.Start = std::time(nullptr);
|
Hint->second.Start = std::time(nullptr);
|
||||||
Hint->second.Done = 0;
|
Hint->second.Done = 0;
|
||||||
Hint->second.Verifications = 0;
|
Hint->second.Verifications = 0;
|
||||||
Hint->second.Secret = GenerateSecret(32);
|
Hint->second.Secret = GenerateSecret(32);
|
||||||
Hint->second.QRCode = QRCode = GenerateQRCode(Hint->second.Secret, User.email);
|
Hint->second.QRCode = QRCode = GenerateQRCode(Hint->second.Secret, User.email);
|
||||||
_OWDEBUG_
|
|
||||||
} else {
|
} else {
|
||||||
_OWDEBUG_
|
|
||||||
QRCode = Hint->second.QRCode;
|
QRCode = Hint->second.QRCode;
|
||||||
_OWDEBUG_
|
|
||||||
}
|
}
|
||||||
_OWDEBUG_
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_OWDEBUG_
|
|
||||||
auto Secret = GenerateSecret(32);
|
auto Secret = GenerateSecret(32);
|
||||||
_OWDEBUG_
|
|
||||||
QRCode = GenerateQRCode(Secret, User.email);
|
QRCode = GenerateQRCode(Secret, User.email);
|
||||||
_OWDEBUG_
|
|
||||||
|
|
||||||
_OWDEBUG_
|
|
||||||
Entry E{ .Subscriber = Subscriber,
|
Entry E{ .Subscriber = Subscriber,
|
||||||
.Start = (uint64_t )std::time(nullptr),
|
.Start = (uint64_t )std::time(nullptr),
|
||||||
.Done = 0,
|
.Done = 0,
|
||||||
@@ -106,9 +95,7 @@ namespace OpenWifi {
|
|||||||
.Secret = Secret,
|
.Secret = Secret,
|
||||||
.QRCode = QRCode
|
.QRCode = QRCode
|
||||||
};
|
};
|
||||||
_OWDEBUG_
|
|
||||||
Cache_[User.id] = E;
|
Cache_[User.id] = E;
|
||||||
_OWDEBUG_
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user