login and register, raw function