added authentication update user action and redirect back to previous page after login