Commit 6b2e7b60 authored by nanahira's avatar nanahira

add temp ban change username

parent 8cb14908
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" ]
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment