Compare commits

...

4 Commits

Author SHA1 Message Date
Elias Schneider
61418a1d8d release: 1.10.1 2025-02-28 13:33:49 +01:00
Elias Schneider
1159d972a8 fix: admin property can't be set if OAuth2 user email doesn't match actual user's email 2025-02-28 13:32:31 +01:00
Elias Schneider
b6d1720fe6 fix: type error when trying to run the seed command 2025-02-28 13:30:20 +01:00
Elias Schneider
dc30f4f3c9 refactor: run formatter 2025-02-28 11:18:10 +01:00
12 changed files with 48 additions and 37 deletions

View File

@@ -1,3 +1,11 @@
## [1.10.1](https://github.com/stonith404/pingvin-share/compare/v1.10.0...v1.10.1) (2025-02-28)
### Bug Fixes
* admin property can't be set if OAuth2 user email doesn't match actual user's email ([1159d97](https://github.com/stonith404/pingvin-share/commit/1159d972a8c32a0d6bf53d161c2fc09e6f8dfb28))
* type error when trying to run the seed command ([b6d1720](https://github.com/stonith404/pingvin-share/commit/b6d1720fe637497ad624c6cdc40058b1b0f0c74c))
## [1.10.0](https://github.com/stonith404/pingvin-share/compare/v1.9.1...v1.10.0) (2025-02-28) ## [1.10.0](https://github.com/stonith404/pingvin-share/compare/v1.9.1...v1.10.0) (2025-02-28)

View File

@@ -50,11 +50,12 @@ COPY --from=backend-builder /opt/app/node_modules ./node_modules
COPY --from=backend-builder /opt/app/dist ./dist COPY --from=backend-builder /opt/app/dist ./dist
COPY --from=backend-builder /opt/app/prisma ./prisma COPY --from=backend-builder /opt/app/prisma ./prisma
COPY --from=backend-builder /opt/app/package.json ./ COPY --from=backend-builder /opt/app/package.json ./
COPY --from=backend-builder /opt/app/tsconfig.json ./
WORKDIR /opt/app WORKDIR /opt/app
COPY ./reverse-proxy /opt/app/reverse-proxy COPY ./reverse-proxy /opt/app/reverse-proxy
COPY ./scripts ./scripts COPY ./scripts/docker ./scripts/docker
EXPOSE 3000 EXPOSE 3000

View File

@@ -1,12 +1,12 @@
{ {
"name": "pingvin-share-backend", "name": "pingvin-share-backend",
"version": "1.10.0", "version": "1.10.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pingvin-share-backend", "name": "pingvin-share-backend",
"version": "1.10.0", "version": "1.10.1",
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.679.0", "@aws-sdk/client-s3": "^3.679.0",
"@nestjs/cache-manager": "^2.2.2", "@nestjs/cache-manager": "^2.2.2",

View File

@@ -1,6 +1,6 @@
{ {
"name": "pingvin-share-backend", "name": "pingvin-share-backend",
"version": "1.10.0", "version": "1.10.1",
"scripts": { "scripts": {
"build": "nest build", "build": "nest build",
"dev": "cross-env NODE_ENV=development nest start --watch", "dev": "cross-env NODE_ENV=development nest start --watch",

View File

@@ -63,7 +63,7 @@ export class OAuthService {
}, },
}); });
if (oauthUser) { if (oauthUser) {
await this.updateIsAdmin(user); await this.updateIsAdmin(oauthUser.userId, user.isAdmin);
const updatedUser = await this.prisma.user.findFirst({ const updatedUser = await this.prisma.user.findFirst({
where: { where: {
id: oauthUser.userId, id: oauthUser.userId,
@@ -170,7 +170,7 @@ export class OAuthService {
userId: existingUser.id, userId: existingUser.id,
}, },
}); });
await this.updateIsAdmin(user); await this.updateIsAdmin(existingUser.id, user.isAdmin);
return this.auth.generateToken(existingUser, { idToken: user.idToken }); return this.auth.generateToken(existingUser, { idToken: user.idToken });
} }
@@ -196,14 +196,13 @@ export class OAuthService {
return result; return result;
} }
private async updateIsAdmin(user: OAuthSignInDto) { private async updateIsAdmin(userId: string, isAdmin?: boolean) {
if ("isAdmin" in user)
await this.prisma.user.update({ await this.prisma.user.update({
where: { where: {
email: user.email, id: userId,
}, },
data: { data: {
isAdmin: user.isAdmin, isAdmin: isAdmin === true,
}, },
}); });
} }

View File

@@ -1,12 +1,12 @@
{ {
"name": "pingvin-share-frontend", "name": "pingvin-share-frontend",
"version": "1.10.0", "version": "1.10.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pingvin-share-frontend", "name": "pingvin-share-frontend",
"version": "1.10.0", "version": "1.10.1",
"dependencies": { "dependencies": {
"@emotion/react": "^11.13.3", "@emotion/react": "^11.13.3",
"@emotion/server": "^11.11.0", "@emotion/server": "^11.11.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "pingvin-share-frontend", "name": "pingvin-share-frontend",
"version": "1.10.0", "version": "1.10.1",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",

View File

@@ -54,7 +54,9 @@ const Admin = () => {
]); ]);
useEffect(() => { useEffect(() => {
configService.isNewReleaseAvailable().then((isNewReleaseAvailable) => { configService
.isNewReleaseAvailable()
.then((isNewReleaseAvailable) => {
if (isNewReleaseAvailable) { if (isNewReleaseAvailable) {
setManagementOptions([ setManagementOptions([
...managementOptions, ...managementOptions,
@@ -66,7 +68,8 @@ const Admin = () => {
}, },
]); ]);
} }
}).catch(); })
.catch();
}, []); }, []);
return ( return (

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "pingvin-share", "name": "pingvin-share",
"version": "1.10.0", "version": "1.10.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pingvin-share", "name": "pingvin-share",
"version": "1.10.0", "version": "1.10.1",
"devDependencies": { "devDependencies": {
"conventional-changelog-cli": "^3.0.0" "conventional-changelog-cli": "^3.0.0"
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "pingvin-share", "name": "pingvin-share",
"version": "1.10.0", "version": "1.10.1",
"scripts": { "scripts": {
"format": "cd frontend && npm run format && cd ../backend && npm run format", "format": "cd frontend && npm run format && cd ../backend && npm run format",
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint", "lint": "cd frontend && npm run lint && cd ../backend && npm run lint",