Conversation
todo: create verification email template
todo: check it works using the client
| @@ -1,5 +1,6 @@ | |||
| import { UnauthorizedException, BadRequestException } from '@nestjs/common'; | |||
| import { Test } from '@nestjs/testing'; | |||
| import { Request } from '🧙♂️/types/request'; | |||
There was a problem hiding this comment.
lol, what's with the 🧙♂️ in the filepath?
There was a problem hiding this comment.
I was exciting to use tsconfig/paths for the first time :)
find-a-mentor-api/tsconfig.json
Lines 14 to 16 in bc67ded
🧙♂️ is our paths root
| const payload = { | ||
| result_url: Config.urls.CLIENT_BASE_URL, | ||
| user_id: auth0UserId, | ||
| identity: { user_id: userId, provider }, |
There was a problem hiding this comment.
Out of curiousity, why are you stripping of the first part of the userId?
It looks like you refer to userId as the part behind the |, while at Auth0 we refer to a userId including what's in front of the |.
Looking at https://auth0.com/docs/manage-users/user-accounts/identify-users, it seems to be that we guarantee the userId to be unique in a tenant (which means, including the part before the |). I am not sure there is any guarantee the part behind the | is unique across multiple providers.
That said, I am not entirely sure here. But if u don't need to strip it, I wouldn't strip it.
There was a problem hiding this comment.
First, this is what works for me :)
The payload's user_id is indeed the full userId.
The identify is the combination of stripped userId and the provider.
Isn't that combination guarantee unique userId?
I can try passing the full userId in identify if you think it ahould work.
There was a problem hiding this comment.
I just wanted to call it out that you are aware. Not asking to change anything. The most important part is that it works for u, just as I mentioned ... If u don't need the stripping, I wouldn't do it. But if u need it, u need it.
There was a problem hiding this comment.
Isn't that combination guarantee unique userId?
Yes but the prefix is part of the userId for us. So seeing it stripped of while still referring to it as a userId can be confusing if you are used to Auth0 UserId's.
There was a problem hiding this comment.
Are you saying I should use the full userid or should I name it differently? If 2, any suggestion?
There was a problem hiding this comment.
Are you saying I should use the full userid or should I name it differently? If 2, any suggestion?
There was a problem hiding this comment.
I think as long as you are aware of the importance of the provider, you should be fine either way.
todo: verify all current users (api)
Client PR - Coding-Coach/find-a-mentor#925