First implementation for login/logout/register