mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-01 03:07:59 +00:00
Fixing Google Authenticator
This commit is contained in:
@@ -202,8 +202,7 @@ namespace OpenWifi {
|
||||
|
||||
if(RawObject->has("userTypeProprietaryInfo")) {
|
||||
if(NewUser.userTypeProprietaryInfo.mfa.enabled) {
|
||||
if (!NewUser.userTypeProprietaryInfo.mfa.method.empty() &&
|
||||
!MFAMETHODS::Validate(NewUser.userTypeProprietaryInfo.mfa.method)) {
|
||||
if (!MFAMETHODS::Validate(NewUser.userTypeProprietaryInfo.mfa.method)) {
|
||||
return BadRequest(RESTAPI::Errors::BadMFAMethod);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,8 +211,7 @@ namespace OpenWifi {
|
||||
|
||||
if(RawObject->has("userTypeProprietaryInfo")) {
|
||||
if(NewUser.userTypeProprietaryInfo.mfa.enabled) {
|
||||
if (!NewUser.userTypeProprietaryInfo.mfa.method.empty() &&
|
||||
!MFAMETHODS::Validate(NewUser.userTypeProprietaryInfo.mfa.method)) {
|
||||
if (!MFAMETHODS::Validate(NewUser.userTypeProprietaryInfo.mfa.method)) {
|
||||
return BadRequest(RESTAPI::Errors::BadMFAMethod);
|
||||
}
|
||||
|
||||
|
||||
@@ -329,6 +329,14 @@ getpreferences() {
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
getauthqrcode() {
|
||||
curl ${FLAGS} -X GET "https://${OWSEC}/api/v1/totp" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: image/svg+xml" \
|
||||
-H "Authorization: Bearer ${token}" \
|
||||
-o qrcode.svg
|
||||
}
|
||||
|
||||
testlogout() {
|
||||
echo "Logged in..."
|
||||
oldtoken=${token}
|
||||
@@ -448,6 +456,7 @@ case "$1" in
|
||||
"systeminfo") login; systeminfo ; logout;;
|
||||
"setpreferences") login; setpreferences "$2" "$3" ; logout;;
|
||||
"getpreferences") login; getpreferences ; logout;;
|
||||
"getauthqrcode") login; getauthqrcode; logout;;
|
||||
"help") login; help ; logout ;;
|
||||
*) help ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user