Skip to content

Commit

Permalink
Fixes error handling in recovery flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryan51203 committed Jan 27, 2024
1 parent 6c55932 commit 1284c2d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions api/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ func HandleGetSettingsFlow(c *gin.Context) {

flow, flow_cookie, err := settings.InitializeSettingsFlowWrapper(session_cookie, recovery_cookie)

c.SetCookie("settings_flow", flow_cookie, 3600, "/", config.NymeriaConfig.URL.Domain, true, true)

if recovery_cookie != "" {
recovery_cookie = "ory_kratos_session=" + recovery_cookie
c.SetCookie("sdslabs_session", recovery_cookie, 900, "/", config.NymeriaConfig.URL.Domain, true, true)
}

flowID := flow.GetId()

if err != nil {
log.ErrorLogger("Initialize Settings flow Failed", err)
c.JSON(http.StatusInternalServerError, gin.H{
Expand All @@ -53,6 +44,15 @@ func HandleGetSettingsFlow(c *gin.Context) {
return
}

c.SetCookie("settings_flow", flow_cookie, 3600, "/", config.NymeriaConfig.URL.Domain, true, true)

if recovery_cookie != "" {
recovery_cookie = "ory_kratos_session=" + recovery_cookie
c.SetCookie("sdslabs_session", recovery_cookie, 900, "/", config.NymeriaConfig.URL.Domain, false, true)
}

flowID := flow.GetId()

var csrf_token string

for _, node := range flow.Ui.Nodes {
Expand Down

0 comments on commit 1284c2d

Please sign in to comment.