Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Rust] update_registration_flow error handling

Aperta
#331 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
api

Direzione di ricerca

Inizia tracciando update_registration_flow e la gestione di ResponseContent per un indirizzo email già registrato. Verifica come viene costruito ErrorBrowserLocationChangeRequired e confronta la relativa entità con lo statuscode della risposta. Il lavoro è completato quando il comportamento con uno statuscode vuoto è coerente e la riproduzione non restituisce più redirect_browser_to come None.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Preflight checklist
Ory Network Project

No response

Describe the bug

UpdateRegistrationFlow ResponseContent.entity returns a different empty status compared to ResponseContent.statuscode. ErrorBrowserLocationChangeRequired always returns None:

pub struct ResponseContent<T> {
    pub status: [StatusCode](https://docs.rs/http/0.2.11/http/status/struct.StatusCode.html),
    pub content: [String](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html),
    pub entity: [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html)<T>,
}
ResponseContent {                                                                                                                                              
    status: 400,                                                                                                                                                          
    content: "{\"id\":\"523d1fbe-ea1c-41f5-9668-ea5f2e835e77\",\"oauth2_login_challenge\":null,\"type\":\"browser\",\"expires_at\":\"2024-02-17T20:32:11.599968Z\",\"issue
d_at\":\"2024-02-17T20:22:11.599968Z\",\"request_url\":\"http://127.0.0.1:4433/self-service/registration/browser\",\"ui\":{\"action\":\"http://127.0.0.1:4455/.ory/kratos/
public/self-service/registration?flow=523d1fbe-ea1c-41f5-9668-ea5f2e835e77\",\"method\":\"POST\",\"nodes\":[{\"type\":\"input\",\"group\":\"default\",\"attributes\":{\"na
me\":\"csrf_token\",\"type\":\"hidden\",\"value\":\"lHGdy8Jg7U2bc4Zj8LSvvi953WxVSvOPOwDlzQt6A1IU5LcDNs1TeTmCPbgRgepwTonOjLUALwkP3kfbpxe4wQ==\",\"required\":true,\"disable
d\":false,\"node_type\":\"input\"},\"messages\":[],\"meta\":{}},{\"type\":\"input\",\"group\":\"password\",\"attributes\":{\"name\":\"traits.email\",\"type\":\"email\",\"
value\":\"[email protected]\",\"required\":true,\"autocomplete\":\"email\",\"disabled\":false,\"node_type\":\"input\"},\"messages\":[],\"meta\":{\"label\":{\"id\":107
0002,\"text\":\"E-Mail\",\"type\":\"info\"}}},{\"type\":\"input\",\"group\":\"password\",\"attributes\":{\"name\":\"password\",\"type\":\"password\",\"required\":true,\"a
utocomplete\":\"new-password\",\"disabled\":false,\"node_type\":\"input\"},\"messages\":[{\"id\":4000005,\"text\":\"The password can not be used because the password has 
been found in data breaches and must no longer be used.\",\"type\":\"error\",\"context\":{\"reason\":\"the password has been found in data breaches and must no longer be 
used\"}}],\"meta\":{\"label\":{\"id\":1070001,\"text\":\"Password\",\"type\":\"info\"}}},{\"type\":\"input\",\"group\":\"password\",\"attributes\":{\"name\":\"traits.name
.first\",\"type\":\"text\",\"value\":\"adsasd\",\"disabled\":false,\"node_type\":\"input\"},\"messages\":[],\"meta\":{\"label\":{\"id\":1070002,\"text\":\"First Name\",\"
type\":\"info\"}}},{\"type\":\"input\",\"group\":\"password\",\"attributes\":{\"name\":\"traits.name.last\",\"type\":\"text\",\"value\":\"asdasd\",\"disabled\":false,\"no
de_type\":\"input\"},\"messages\":[],\"meta\":{\"label\":{\"id\":1070002,\"text\":\"Last Name\",\"type\":\"info\"}}},{\"type\":\"input\",\"group\":\"password\",\"attribut
es\":{\"name\":\"method\",\"type\":\"submit\",\"value\":\"password\",\"disabled\":false,\"node_type\":\"input\"},\"messages\":[],\"meta\":{\"label\":{\"id\":1040001,\"tex
t\":\"Sign up\",\"type\":\"info\",\"context\":{}}}}]}}\n",                                                                                                                
    entity: Some(                                                                                                                                                         
        Status422(                                                                                                                                                        
            ErrorBrowserLocationChangeRequired {                                                                                                                          
                error: None,                                                                                                                                              
                redirect_browser_to: None,                                                                                                                                
            },                                                                                                                                                            
        ),                                                                                                                                                                
    ),                                                                                                                                                                    
}
Reproducing the bug

Make a post request with an already registered email address.

Relevant log output

No response

Relevant configuration

No response

Version

ory-client 1.6.1 with latest docker container

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker Compose

Additional Context

No response

Lingua principale
PHP
Stelle
178
Fork
96
Merge medio
1g 19h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ory/sdk

Tutte le issue di ory/sdk

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.