The next pathname of the location object is only set by the auth
redirect flow, which is not executed when the user navigates directly to
/login. Setting Login.defaultProps was an attempt to address this
edge-case, but it seems that React only performs a shallow merge of
defaultProps with the incoming props. Instead, we explicitly set the
pathname to / if location.state.nextPathname is unset.
The next pathname of the location object is only set by the auth redirect flow, which is not executed when the user navigates directly to
/login
. SettingLogin.defaultProps
was an attempt to address this edge-case, but it seems that React only performs a shallow merge ofdefaultProps
with the incoming props. Instead, we explicitly set the pathname to/
iflocation.state.nextPathname
is unset.