-
Notifications
You must be signed in to change notification settings - Fork 1
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
Set up AWS Cognito for log-in #13
base: main
Are you sure you want to change the base?
Conversation
import { ApplicationStatus } from './types'; | ||
|
||
@Entity() | ||
export class Application { |
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.
Is there a schema/description of what data we're working with here? I'm curious how this connects to other pieces of data we'll have
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.
also, what does an Application
represent? Is it someone's application to join the site?
) {} | ||
|
||
@Post('/signup') | ||
async createUser(@Body() signUpDto: SignUpRequestDTO): Promise<Application> { |
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 also want to create a user record here through the UsersService
? Or are we planning on taking care of that in another way somewhere else?
async findOne(currentUser: User, userId: number): Promise<User> { | ||
const user = await this.usersRepository.findOne({ | ||
where: { id: userId } | ||
}); |
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 think we can split this method up (or if not, maybe rename to something more descriptive) - from what I understand, right now it's doing two things: fetching a user by ID (and making sure they actually exist), and making sure the calling user is allowed to access the fetched user. I imagine we might want to do either of those things independently of each other, and having the two different methods would be super helpful then.
@Column('varchar') | ||
@IsBoolean() | ||
safety?: boolean; |
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'm not super familiar with data in Nest, so a couple questions here:
- Are the
@IsBoolean()
(and related decorators) necessary? I don't see them in the scaffolding repo - was there some edge case you ran into while building this? - How does defining the column as
varchar
and typing it as a boolean end up storing the record? Is it stored as text (like "true" or "false")? - Does marking the field as optional with
?
do the same thing as adding theIsOptional()
decorator?
Closes: https://www.notion.so/mahekagg/Set-up-AWS-Cognito-for-log-in-7d05a45ed3ee44779a21d6f72ba8fd97