Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Moecube Accounts Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Moecube Accounts Backend
Commits
6b2e7b60
Commit
6b2e7b60
authored
Jul 04, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add temp ban change username
parent
8cb14908
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
Dockerfile
Dockerfile
+3
-4
src/controllers/user.ts
src/controllers/user.ts
+5
-1
No files found.
Dockerfile
View file @
6b2e7b60
FROM
node
FROM
node
:buster-slim
RUN
mkdir
-p
/usr/src/app
RUN
mkdir
-p
/usr/src/app
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
COPY
package.json /usr/src/app/
COPY
package*.json /usr/src/app/
COPY
package-lock.json /usr/src/app/
RUN
npm ci
&&
npm cache clean
--force
RUN
npm
install
&&
npm cache clean
--force
COPY
. /usr/src/app
COPY
. /usr/src/app
CMD
[ "npm", "start" ]
CMD
[ "npm", "start" ]
src/controllers/user.ts
View file @
6b2e7b60
...
@@ -56,6 +56,10 @@ export const UpdateProfiles = async (ctx: Context) => {
...
@@ -56,6 +56,10 @@ export const UpdateProfiles = async (ctx: Context) => {
ctx
.
throw
(
400
);
ctx
.
throw
(
400
);
}
}
if
(
user
.
username
&&
process
.
env
.
NO_CHANGE_USERNAME
)
{
ctx
.
throw
(
"
Changing username is currently not allowed.
"
,
400
);
}
const
userRep
=
getEntityManager
().
getRepository
(
User
);
const
userRep
=
getEntityManager
().
getRepository
(
User
);
let
_user
:
User
|
undefined
=
await
userRep
let
_user
:
User
|
undefined
=
await
userRep
...
@@ -209,4 +213,4 @@ export const getUserAvatar = async (ctx: Context) => {
...
@@ -209,4 +213,4 @@ export const getUserAvatar = async (ctx: Context) => {
return
ctx
.
throw
(
404
);
return
ctx
.
throw
(
404
);
}
}
ctx
.
body
=
user
.
avatarURL
()
ctx
.
body
=
user
.
avatarURL
()
};
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment