-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication #30
base: main
Are you sure you want to change the base?
Authentication #30
Conversation
Integrated Swagger for API documentation using OpenAPI in the backend.
Introduced a new `authSchId` column in the `User` table to store unique identifiers for authentication with AuthSch.
Dropped the CardRight table. Updated the User and ProfilePicture models. Adjusted DTOs and entities to reflect these schema changes.
Dropped the CardRight table. Updated the User and ProfilePicture models. Adjusted DTOs and entities to reflect these schema changes.
Introduced a new authentication module utilizing AuthSCH for login and JWT for session handling. This includes controllers, services, and strategy definitions for handling authentication, along with necessary dependency updates and environment variables.
Configured CORS to allow requests from the frontend URL specified in the environment variables. Supported HTTP methods include GET, PUT, PATCH, POST, and DELETE, with credentials enabled for secure cross-origin communication.
Updated database schema to introduce `DormResidency` and `ClubMembership` models and enums, replacing previous user-level fields like `isDormResident` and `roomAccess` and adjusted related code.
Introduced a new optional field, `clubMembershipStatusUpdatedAt`, to the User model in Prisma schema and database migrations. This allows tracking when a user's club membership status was last updated.
Introduced a new Memberships module, including DTOs, service, and controller, establishing foundational CRUD functionality for managing memberships.
Implemented logic to update or remove club membership information based on user profiles from AuthSch. Extended `.env.example` with new environment variables to support membership status checks.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@Tschonti What can we do about the incompatibility issue? |
Oof sorry, I'll update the package soon |
update the package to v2.2.2 and it should be okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed the changes and it looked good, as far, as I could tell. I have left a comment for the auth service.
Regarding the PÉK sync, I don't think it's necessary to update the info on every sign in, since it doesn't change that often. Could you explain what you mean by approval system? Isn't there a PÉK API, that we could use to monitor changes made to MMMK and sync the users accordingly?
}); | ||
} | ||
|
||
async syncClubMembership(user: User, userProfile: AuthSchProfile): Promise<User> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't there be a problem with this if PÉK contains depricated information? For example, I'm currently a gatekeeper in MMMK, but on PÉK I don't have the gatekeeper role.
Implemented AuthSch authentication, tho I'm concerned about the synchronization part with Pék. Should we update the membership information on every sign-in, or should we implement something like an approval system on incoming changes? So, I'm open to any constructive observations.
This pull request introduces several significant updates to the backend application, including the addition of authentication with AuthSch, database schema changes, and various improvements to the codebase. Below are the most important changes grouped by theme.
Authentication and Authorization:
apps/backend/src/auth/auth.controller.ts
,apps/backend/src/auth/auth.module.ts
,apps/backend/src/auth/auth.service.ts
,apps/backend/src/auth/authsch.strategy.ts
,apps/backend/src/auth/jwt.strategy.ts
). [1] [2] [3] [4] [5]Database Schema Changes:
apps/backend/prisma/migrations/20241223144157_authsch/migration.sql
,apps/backend/prisma/migrations/20241223185015_user_update/migration.sql
,apps/backend/prisma/migrations/20241224023154_clubmembership/migration.sql
,apps/backend/prisma/migrations/20241224031453_membership_updated_at/migration.sql
,apps/backend/prisma/schema.prisma
). [1] [2] [3] [4] [5] [6] [7]Configuration Updates:
.env.example
to include new environment variables for authentication and application URLs (apps/backend/.env.example
).Dependency Updates:
apps/backend/package.json
).API and Code Enhancements:
apps/backend/src/memberships/dto/create-membership.dto.ts
,apps/backend/src/memberships/dto/update-membership.dto.ts
,apps/backend/src/memberships/entities/membership.entity.ts
,apps/backend/src/band/band.service.ts
). [1] [2] [3] [4]apps/backend/src/main.ts
).