Skip to content

Commit

Permalink
Add back auth methods for now
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Dec 4, 2024
1 parent 5e8cb2e commit a5e31d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion desktop/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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))
Expand All @@ -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")
}
2 changes: 2 additions & 0 deletions internalsdk/pro/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a5e31d0

Please sign in to comment.