-
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
Feat/12 auth #13
Feat/12 auth #13
Conversation
return await this.prisma.user.create({ | ||
data: { | ||
authSchId: userProfile.authSchId, | ||
fullName: `${userProfile.lastName} ${userProfile.firstName}`, //this is kinda cring... |
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.
Im not sure, how this handles third names here...
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.
the displayName scope and property from authSch is actually the full name. I thought it was the authsch username, but no. Might be worth renaming it in the package
nickName: userProfile.firstName, | ||
email: userProfile.email, | ||
isSchResident: true, | ||
//TODO: Find a solution for only dorm residents. The userProfile.bmeStatus is undefined. Is it an admin enabled info? |
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.
And this seems to not work here. Until we find a solution this seems useful for development purposes
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.
you need to add the BME_STATUS scope in the constructor to access that field. Still, that won't help with dorm residency.
Ohh, and I added Swagger, as we will hopefully use it later. |
apps/backend/src/main.ts
Outdated
|
||
import { AppModule } from './app.module'; | ||
|
||
async function bootstrap() { | ||
const app = await NestFactory.create(AppModule); | ||
await app.listen(3001); | ||
app.enableCors({ | ||
origin: [process.env.FRONTEND_URL, 'http://localhost:3000'], |
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.
maybe only put localhost here if we're not in production?
fullName: userProfile.displayName, | ||
nickName: userProfile.firstName, | ||
email: userProfile.email, | ||
isSchResident: userProfile.bmeStatus.includes(BmeUnitScope.BME_VIK_ACTIVE), |
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.
It think we need an isActiveVikStudent column in the enitity too
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.
do we even need these fields in the db? They will only ever be used when a registration period has ended, but then we will need to query authSch for up-to-date info, I don't see much use of storing this data.
Added basic auth with the new awesome kir-dev package!