Open nsklikas opened 1 hour ago
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-1226.
This message was autogenerated
It looks that we can replace it with SessionAuthenticationMethod
:
$ 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)
Originally posted by @nsklikas in https://github.com/canonical/identity-platform-login-ui/pull/372#pullrequestreview-2461495884