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
72b954af00
commit
7954e38643
|
@ -14,7 +14,7 @@ impl Instance {
|
|||
///
|
||||
/// # Reference
|
||||
/// 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 chorus_request = ChorusRequest {
|
||||
request: Client::new()
|
||||
|
|
|
@ -19,7 +19,7 @@ impl Instance {
|
|||
/// # Reference
|
||||
/// See <https://docs.spacebar.chat/routes/#post-/auth/register/>
|
||||
pub async fn register_account(
|
||||
mut self,
|
||||
&mut self,
|
||||
register_schema: RegisterSchema,
|
||||
) -> ChorusResult<ChorusUser> {
|
||||
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();
|
||||
}
|
||||
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 gateway: GatewayHandle = Gateway::spawn(self.urls.wss.clone()).await.unwrap();
|
||||
identify.token = token.clone();
|
||||
|
|
Loading…
Reference in New Issue