[MM-16512] Migrate Token.Save to Sync by default (#11353)
* [MM-16512] Migrate Token.Save to Sync by default * refactor: formatting * test: add checks for errors while saving tokens * test: fixup
Этот коммит содержится в:
@@ -93,7 +93,7 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
app.TOKEN_TYPE_TEAM_INVITATION,
|
||||
model.MapToJson(map[string]string{"teamId": th.BasicTeam.Id, "email": user.Email}),
|
||||
)
|
||||
<-th.App.Srv.Store.Token().Save(token)
|
||||
require.Nil(t, th.App.Srv.Store.Token().Save(token))
|
||||
|
||||
ruser, resp := th.Client.CreateUserWithToken(&user, token.Token)
|
||||
CheckNoError(t, resp)
|
||||
@@ -124,7 +124,7 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
app.TOKEN_TYPE_TEAM_INVITATION,
|
||||
model.MapToJson(map[string]string{"teamId": th.BasicTeam.Id, "email": user.Email}),
|
||||
)
|
||||
<-th.App.Srv.Store.Token().Save(token)
|
||||
require.Nil(t, th.App.Srv.Store.Token().Save(token))
|
||||
defer th.App.DeleteToken(token)
|
||||
|
||||
_, resp := th.Client.CreateUserWithToken(&user, "")
|
||||
@@ -141,7 +141,7 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
model.MapToJson(map[string]string{"teamId": th.BasicTeam.Id, "email": user.Email}),
|
||||
)
|
||||
token.CreateAt = past49Hours
|
||||
<-th.App.Srv.Store.Token().Save(token)
|
||||
require.Nil(t, th.App.Srv.Store.Token().Save(token))
|
||||
defer th.App.DeleteToken(token)
|
||||
|
||||
_, resp := th.Client.CreateUserWithToken(&user, token.Token)
|
||||
@@ -170,7 +170,7 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
app.TOKEN_TYPE_TEAM_INVITATION,
|
||||
model.MapToJson(map[string]string{"teamId": th.BasicTeam.Id, "email": user.Email}),
|
||||
)
|
||||
<-th.App.Srv.Store.Token().Save(token)
|
||||
require.Nil(t, th.App.Srv.Store.Token().Save(token))
|
||||
defer th.App.DeleteToken(token)
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableUserCreation = false })
|
||||
@@ -188,7 +188,7 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
app.TOKEN_TYPE_TEAM_INVITATION,
|
||||
model.MapToJson(map[string]string{"teamId": th.BasicTeam.Id, "email": user.Email}),
|
||||
)
|
||||
<-th.App.Srv.Store.Token().Save(token)
|
||||
require.Nil(t, th.App.Srv.Store.Token().Save(token))
|
||||
|
||||
enableOpenServer := th.App.Config().TeamSettings.EnableOpenServer
|
||||
defer func() {
|
||||
|
||||
Ссылка в новой задаче
Block a user