mirror of
https://github.com/plankanban/planka.git
synced 2025-12-16 09:13:18 +03:00
feat: Add S3 support for uploads (#938)
This commit is contained in:
@@ -148,6 +148,14 @@ module.exports = {
|
||||
|
||||
customToJSON() {
|
||||
const isDefaultAdmin = this.email === sails.config.custom.defaultAdminEmail;
|
||||
let avatarUrl = '';
|
||||
if (this.avatar) {
|
||||
if (this.avatar.square) {
|
||||
avatarUrl = this.avatar.square;
|
||||
} else {
|
||||
avatarUrl = `${sails.config.custom.userAvatarsUrl}/${this.avatar.dirname}/square-100.${this.avatar.extension}`;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
..._.omit(this, ['password', 'isSso', 'avatar', 'passwordChangedAt']),
|
||||
@@ -155,9 +163,7 @@ module.exports = {
|
||||
isRoleLocked: (this.isSso && !sails.config.custom.oidcIgnoreRoles) || isDefaultAdmin,
|
||||
isUsernameLocked: (this.isSso && !sails.config.custom.oidcIgnoreUsername) || isDefaultAdmin,
|
||||
isDeletionLocked: isDefaultAdmin,
|
||||
avatarUrl:
|
||||
this.avatar &&
|
||||
`${sails.config.custom.userAvatarsUrl}/${this.avatar.dirname}/square-100.${this.avatar.extension}`,
|
||||
avatarUrl,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user