diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index fbadb31..eb79f8f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,10 @@
-
+
-
-
-
-
+
+
@@ -156,7 +154,6 @@
-
@@ -181,7 +178,8 @@
-
+
+
true
diff --git a/pkg/internal/models/auth.go b/pkg/internal/models/auth.go
index 3c4dd8d..c481eb4 100644
--- a/pkg/internal/models/auth.go
+++ b/pkg/internal/models/auth.go
@@ -8,7 +8,7 @@ import (
)
type AuthConfig struct {
- MaximumAuthSteps int `json:"maximum_auth_steps" validate:"required,min=1"`
+ MaximumAuthSteps int `json:"maximum_auth_steps"`
}
type AuthFactorType = int8
diff --git a/pkg/internal/services/ticket.go b/pkg/internal/services/ticket.go
index beda37a..2451112 100644
--- a/pkg/internal/services/ticket.go
+++ b/pkg/internal/services/ticket.go
@@ -15,7 +15,7 @@ import (
const InternalTokenAudience = "solar-network"
-// DetectRisk is used for detect user environment is suitable for no multi-factor authenticate or not.
+// DetectRisk is used for detect user environment is suitable for no multifactorial authenticating or not.
// Return the remaining steps, value is from 1 to 2, may appear 3 if user enabled the third-authentication-factor.
func DetectRisk(user models.Account, ip, ua string) int {
var clue int64
@@ -25,11 +25,11 @@ func DetectRisk(user models.Account, ip, ua string) int {
Model(models.AuthTicket{}).
Count(&clue).Error; err == nil {
if clue >= 1 {
- return 1
+ return 3
}
}
- return 2
+ return 3
}
// PickTicketAttempt is trying to pick up the ticket that hasn't completed but created by a same client (identify by ip address).