feat: add default privileges for new user

This commit is contained in:
skeris 2023-11-13 02:39:05 +03:00
parent 39aa4162e2
commit c1e17fe655
3 changed files with 11 additions and 1 deletions

BIN
app

Binary file not shown.

@ -111,6 +111,16 @@ func (h *Handlers) AmoSaveToken(w http.ResponseWriter, r *http.Request) {
Subdomain: accountAmo.Subdomain,
ExpiresIn: token.Expiry,
TokenType: token.TokenType,
Privileges: map[string]model.ShortPrivilige{
model.PrivilegeTemplateCount: model.ShortPrivilige{
Amount: model.BasicAmountPrivilegeTemplateCount,
CreatedAt: time.Now(),
},
model.PrivilegeTemplateStorage: model.ShortPrivilige{
Amount: model.BasicAmountPrivilegeTemplateStorage,
CreatedAt: time.Now(),
},
},
})
if err != nil {
h.reportError(w, http.StatusInternalServerError, err)