Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Sep 24, 2024
1 parent 1d882c5 commit 13d11b8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions selfservice/strategy/profile/two_step_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ func (s *Strategy) PopulateRegistrationMethod(r *http.Request, f *registration.F
return nil
}

// The RegistrationScreen
// swagger:enum RegistrationScreen
type RegistrationScreen string

const (
RegistrationScreenCredentialSelection RegistrationScreen = "credential-selection"
RegistrationScreenPrevious RegistrationScreen = "previous"
)

// Update Registration Flow with Profile Method
//
// swagger:model updateRegistrationFlowWithProfileMethod
Expand Down Expand Up @@ -94,7 +103,7 @@ type updateRegistrationFlowWithProfileMethod struct {
// selection screen.
//
// required: false
Screen string `json:"screen" form:"screen"`
Screen RegistrationScreen `json:"screen" form:"screen"`

// FlowIDRequestID is the flow ID.
//
Expand Down Expand Up @@ -131,17 +140,13 @@ func (s *Strategy) Register(w http.ResponseWriter, r *http.Request, regFlow *reg
return s.handleRegistrationError(r, regFlow, params, err)
}

if params.Screen == "credential-selection" {
params.Method = "profile"
}

if params.Method == "profile" {
if params.Method == "profile" || params.Screen == RegistrationScreenCredentialSelection {
return s.displayStepTwoNodes(ctx, w, r, regFlow, i, params)
} else if params.Method == "profile:back" {
// "profile:back" is kept for backwards compatibility.
span.AddEvent(semconv.NewDeprecatedFeatureUsedEvent(ctx, "profile:back"))
return s.displayStepOneNodes(ctx, w, r, regFlow, params)
} else if params.Screen == "previous" {
} else if params.Screen == RegistrationScreenPrevious {
return s.displayStepOneNodes(ctx, w, r, regFlow, params)
}

Expand Down
9 changes: 7 additions & 2 deletions spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3244,8 +3244,13 @@
"type": "string"
},
"screen": {
"description": "Screen requests navigation to a previous screen.\n\nThis must be set to credential-selection to go back to the credential\nselection screen.",
"type": "string"
"description": "Screen requests navigation to a previous screen.\n\nThis must be set to credential-selection to go back to the credential\nselection screen.\ncredential-selection RegistrationScreenCredentialSelection\nprevious RegistrationScreenPrevious",
"enum": [
"credential-selection",
"previous"
],
"type": "string",
"x-go-enum-desc": "credential-selection RegistrationScreenCredentialSelection\nprevious RegistrationScreenPrevious"
},
"traits": {
"description": "Traits\n\nThe identity's traits.",
Expand Down
9 changes: 7 additions & 2 deletions spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6228,8 +6228,13 @@
"type": "string"
},
"screen": {
"description": "Screen requests navigation to a previous screen.\n\nThis must be set to credential-selection to go back to the credential\nselection screen.",
"type": "string"
"description": "Screen requests navigation to a previous screen.\n\nThis must be set to credential-selection to go back to the credential\nselection screen.\ncredential-selection RegistrationScreenCredentialSelection\nprevious RegistrationScreenPrevious",
"type": "string",
"enum": [
"credential-selection",
"previous"
],
"x-go-enum-desc": "credential-selection RegistrationScreenCredentialSelection\nprevious RegistrationScreenPrevious"
},
"traits": {
"description": "Traits\n\nThe identity's traits.",
Expand Down

0 comments on commit 13d11b8

Please sign in to comment.