-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove MethodOnly struct #374
Labels
enhancement
New feature or request
Comments
Thank you for reporting us your feedback! The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-1226.
|
It looks that we can replace it with $ git diff
diff --git a/pkg/kratos/service.go b/pkg/kratos/service.go
index cf97eb1..c1a6272 100644
--- a/pkg/kratos/service.go
+++ b/pkg/kratos/service.go
@@ -75,10 +75,6 @@ type UiErrorMessages struct {
Ui kClient.UiContainer `json:"ui"`
}
-type methodOnly struct {
- Method string `json:"method"`
-}
-
type LookupSecrets []struct {
Code string `json:"code"`
UsedAt time.Time `json:"used_at,omitempty"`
@@ -591,7 +587,7 @@ func (s *Service) ParseLoginFlowMethodBody(r *http.Request) (*kClient.UpdateLogi
ret kClient.UpdateLoginFlowBody
cookies = r.Cookies()
)
- methodOnly := new(methodOnly)
+ methodOnly := new(kClient.SessionAuthenticationMethod)
defer r.Body.Close()
b, err := io.ReadAll(r.Body)
@@ -607,7 +603,7 @@ func (s *Service) ParseLoginFlowMethodBody(r *http.Request) (*kClient.UpdateLogi
return nil, cookies, err
}
- switch methodOnly.Method {
+ switch methodOnly.GetMethod() {
case "password":
body := new(kClient.UpdateLoginFlowWithPasswordMethod)
@@ -669,7 +665,7 @@ func (s *Service) ParseLoginFlowMethodBody(r *http.Request) (*kClient.UpdateLogi
)
}
- if s.is1FAMethod(methodOnly.Method) {
+ if s.is1FAMethod(methodOnly.GetMethod()) {
for i, c := range cookies {
if c.Name == KRATOS_SESSION_COOKIE_NAME {
if i == len(cookies)-1 {
@@ -703,7 +699,7 @@ func (s *Service) ParseRecoveryFlowMethodBody(r *http.Request) (*kClient.UpdateR
}
func (s *Service) ParseSettingsFlowMethodBody(r *http.Request) (*kClient.UpdateSettingsFlowBody, error) {
- methodOnly := new(methodOnly)
+ methodOnly := new(kClient.SessionAuthenticationMethod)
defer r.Body.Close()
b, err := io.ReadAll(r.Body)
@@ -721,7 +717,7 @@ func (s *Service) ParseSettingsFlowMethodBody(r *http.Request) (*kClient.UpdateS
var ret kClient.UpdateSettingsFlowBody
- switch methodOnly.Method {
+ switch methodOnly.GetMethod() {
case "password":
body := new(kClient.UpdateSettingsFlowWithPasswordMethod) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally posted by @nsklikas in #372 (review)
The text was updated successfully, but these errors were encountered: