useLocation returns the current location object, which can be stored in redirect state for post-login navigation.