fixed bug where login function was not authing before checking for session