From a5e31d0b0c01c42de235c113342d4466a9a45889 Mon Sep 17 00:00:00 2001 From: atavism Date: Wed, 4 Dec 2024 11:38:24 -0800 Subject: [PATCH] Add back auth methods for now --- desktop/auth.go | 10 +++++++++- internalsdk/pro/user.go | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop/auth.go b/desktop/auth.go index 944172eba..473a8d651 100644 --- a/desktop/auth.go +++ b/desktop/auth.go @@ -128,6 +128,10 @@ func logout() *C.char { } clearLocalUserData() + // Create new user + if _, err := a.ProClient().UserCreate(ctx); err != nil { + return sendError(err) + } return C.CString("true") } @@ -295,7 +299,7 @@ func deleteAccount(password *C.char) *C.char { if err != nil { return sendError(err) } - log.Debugf("Account Delted response %v", isAccountDeleted) + log.Debugf("Account deleted response %v", isAccountDeleted) if !isAccountDeleted { return sendError(log.Errorf("user_not_found error while deleting account %v", err)) @@ -305,5 +309,9 @@ func deleteAccount(password *C.char) *C.char { clearLocalUserData() // Set user id and token to nil a.Settings().SetUserIDAndToken(0, "") + // Create new user + if _, err := a.ProClient().UserCreate(ctx); err != nil { + return sendError(err) + } return C.CString("true") } diff --git a/internalsdk/pro/user.go b/internalsdk/pro/user.go index b90f25651..c733f45f5 100644 --- a/internalsdk/pro/user.go +++ b/internalsdk/pro/user.go @@ -34,6 +34,8 @@ type backoffRunner struct { isRunning bool } +// createUser submits a request to create a new user with the Pro user and +// configures a new client session func (c *proClient) createUser(ctx context.Context, session ClientSession) error { log.Debug("New user, calling user create") resp, err := c.UserCreate(ctx)