added functions for getting user and handling login success handler