mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-02-23 15:50:00 +01:00
imp(flows) don't require present_user_url to return an additional char
For custom AuthenticatorDelegate implementations it may be very weird to be required to return an additional character after the code from present_user_url. One may find himself chasing the bug which is bad UX for the user. Improve this behavior and therefore introduce a breaking change that will hopefully not break existing implementations nevertheless.
This commit is contained in:
@@ -137,7 +137,11 @@ pub trait AuthenticatorDelegate {
|
||||
url);
|
||||
|
||||
let mut code = String::new();
|
||||
io::stdin().read_line(&mut code).ok().map(|_| code)
|
||||
io::stdin().read_line(&mut code).ok().map(|_| {
|
||||
// Remove newline
|
||||
code.pop();
|
||||
code
|
||||
})
|
||||
} else {
|
||||
println!("Please direct your browser to {} and follow the instructions displayed \
|
||||
there.",
|
||||
|
||||
Reference in New Issue
Block a user