Change: register/login no longer require ownership
Register/login used to require ownership of `instance`. This wasn't really necessary and has been changed.
This commit is contained in:
parent
9ad01cd227
commit
e06edada1e
|
@ -14,7 +14,7 @@ impl Instance {
|
||||||
///
|
///
|
||||||
/// # Reference
|
/// # Reference
|
||||||
/// See <https://docs.spacebar.chat/routes/#post-/auth/login/>
|
/// See <https://docs.spacebar.chat/routes/#post-/auth/login/>
|
||||||
pub async fn login_account(mut self, login_schema: LoginSchema) -> ChorusResult<ChorusUser> {
|
pub async fn login_account(&mut self, login_schema: LoginSchema) -> ChorusResult<ChorusUser> {
|
||||||
let endpoint_url = self.urls.api.clone() + "/auth/login";
|
let endpoint_url = self.urls.api.clone() + "/auth/login";
|
||||||
let chorus_request = ChorusRequest {
|
let chorus_request = ChorusRequest {
|
||||||
request: Client::new()
|
request: Client::new()
|
||||||
|
|
|
@ -19,7 +19,7 @@ impl Instance {
|
||||||
/// # Reference
|
/// # Reference
|
||||||
/// See <https://docs.spacebar.chat/routes/#post-/auth/register/>
|
/// See <https://docs.spacebar.chat/routes/#post-/auth/register/>
|
||||||
pub async fn register_account(
|
pub async fn register_account(
|
||||||
mut self,
|
&mut self,
|
||||||
register_schema: RegisterSchema,
|
register_schema: RegisterSchema,
|
||||||
) -> ChorusResult<ChorusUser> {
|
) -> ChorusResult<ChorusUser> {
|
||||||
let endpoint_url = self.urls.api.clone() + "/auth/register";
|
let endpoint_url = self.urls.api.clone() + "/auth/register";
|
||||||
|
@ -43,7 +43,7 @@ impl Instance {
|
||||||
self.limits_information.as_mut().unwrap().ratelimits = shell.limits.unwrap();
|
self.limits_information.as_mut().unwrap().ratelimits = shell.limits.unwrap();
|
||||||
}
|
}
|
||||||
let user_object = self.get_user(token.clone(), None).await.unwrap();
|
let user_object = self.get_user(token.clone(), None).await.unwrap();
|
||||||
let settings = ChorusUser::get_settings(&token, &self.urls.api.clone(), &mut self).await?;
|
let settings = ChorusUser::get_settings(&token, &self.urls.api.clone(), self).await?;
|
||||||
let mut identify = GatewayIdentifyPayload::common();
|
let mut identify = GatewayIdentifyPayload::common();
|
||||||
let gateway: GatewayHandle = Gateway::spawn(self.urls.wss.clone()).await.unwrap();
|
let gateway: GatewayHandle = Gateway::spawn(self.urls.wss.clone()).await.unwrap();
|
||||||
identify.token = token.clone();
|
identify.token = token.clone();
|
||||||
|
|
Loading…
Reference in New Issue