login+regist all in full function