mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-24 16:41:30 +02:00
[android] dismiss the SSH auth browser once the token arrives
The JWT device-code flow opened the verification URL through the URL opener but never told it the round-trip had finished, so the Custom Tab stayed in front of the terminal after the token had already been collected and the user had to dismiss it by hand. Call OnLoginSuccess once a non-empty token is in hand, which is what the login and session-extend flows already do; the Android side reacts by bringing its own activity forward.
This commit is contained in:
@@ -373,6 +373,13 @@ func (s *SSHClient) requestJWTToken(cfg *profilemanager.Config) (string, error)
|
||||
if token == "" {
|
||||
return "", errors.New("empty token returned by IdP")
|
||||
}
|
||||
|
||||
// Tells the client the browser round-trip is over so it can dismiss the
|
||||
// surface it opened, the same way the login and session-extend flows do.
|
||||
// Without it the Custom Tab stays in front of the terminal even though the
|
||||
// token has already been collected.
|
||||
go urlOpener.OnLoginSuccess()
|
||||
|
||||
return token, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user