Fix new users theme assignment (#1684)
This commit is contained in:
parent
e5a9e91f3f
commit
9c6198b512
@ -11,6 +11,7 @@ import (
|
||||
"github.com/cortezaproject/corteza/server/pkg/eventbus"
|
||||
"github.com/cortezaproject/corteza/server/pkg/handle"
|
||||
"github.com/cortezaproject/corteza/server/pkg/payload"
|
||||
"github.com/cortezaproject/corteza/server/pkg/sass"
|
||||
"github.com/cortezaproject/corteza/server/store"
|
||||
"github.com/cortezaproject/corteza/server/system/service/event"
|
||||
"github.com/cortezaproject/corteza/server/system/types"
|
||||
@ -382,6 +383,13 @@ func (svc *auth) InternalSignUp(ctx context.Context, input *types.User, password
|
||||
createUserHandle(ctx, svc.store, nUser)
|
||||
}
|
||||
|
||||
if nUser.Meta == nil {
|
||||
nUser.Meta = &types.UserMeta{}
|
||||
}
|
||||
|
||||
//set default user's theme
|
||||
nUser.Meta.Theme = sass.LightTheme
|
||||
|
||||
if err = uniqueUserCheck(ctx, svc.store, nUser); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -388,14 +388,18 @@ func (svc user) Create(ctx context.Context, new *types.User) (u *types.User, err
|
||||
return
|
||||
}
|
||||
|
||||
//add default user's theme
|
||||
new.Meta.Theme = sass.LightTheme
|
||||
if new.Meta == nil {
|
||||
new.Meta = &types.UserMeta{}
|
||||
}
|
||||
|
||||
// Process avatar initials Image
|
||||
if err = svc.generateUserAvatarInitial(ctx, new); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
//add default user's theme
|
||||
new.Meta.Theme = sass.LightTheme
|
||||
|
||||
new.ID = nextID()
|
||||
new.CreatedAt = *now()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user