def sign_in(self): session['user_details'] = {"email": self.email_address, "id": self.id} if not self.is_active: return False if self.email_auth and len(self.security_keys) == 0: user_api_client.send_verify_code(self.id, 'email', None, request.args.get('next')) if self.sms_auth and len(self.security_keys) == 0: user_api_client.send_verify_code(self.id, 'sms', self.mobile_number) return True
def sign_in(self): session["user_details"] = {"email": self.email_address, "id": self.id} if not self.is_active: return False if self.email_auth and len(self.security_keys) == 0: user_api_client.send_verify_code(self.id, "email", None, request.args.get("next")) user_api_client.register_last_email_login_datetime(self.id) return True if self.sms_auth and len(self.security_keys) == 0: user_api_client.send_verify_code(self.id, "sms", self.mobile_number) return True
def send_verify_code(self, to=None): user_api_client.send_verify_code(self.id, 'sms', to or self.mobile_number)