diff --git a/selfservice/flow/login/hook.go b/selfservice/flow/login/hook.go index 595fdbff7936..f0e06ccfc934 100644 --- a/selfservice/flow/login/hook.go +++ b/selfservice/flow/login/hook.go @@ -320,6 +320,9 @@ func (e *HookExecutor) PostLoginHook( } finalReturnTo = rt span.SetAttributes(attribute.String("return_to", rt), attribute.String("redirect_reason", "oauth2 login challenge")) + } else if f.ReturnToVerification != "" { + finalReturnTo = f.ReturnToVerification + span.SetAttributes(attribute.String("redirect_reason", "verification requested")) } x.ContentNegotiationRedirection(w, r, s, e.d.Writer(), finalReturnTo)