Skip to content
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: verify email #249

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

feat: verify email #249

wants to merge 10 commits into from

Conversation

moshfeu
Copy link
Member

@moshfeu moshfeu commented Apr 28, 2022

todo: verify all current users (api)

Client PR - Coding-Coach/find-a-mentor#925

@moshfeu moshfeu requested review from brentmclark and crysfel May 4, 2022 08:50
@@ -1,5 +1,6 @@
import { UnauthorizedException, BadRequestException } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { Request } from '🧙‍♂️/types/request';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, what's with the 🧙‍♂️ in the filepath?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was exciting to use tsconfig/paths for the first time :)

"paths": {
"🧙‍♂️/types/*": ["src/types/*"]
}

🧙‍♂️ is our paths root

@brentmclark brentmclark self-requested a review May 4, 2022 13:15
const payload = {
result_url: Config.urls.CLIENT_BASE_URL,
user_id: auth0UserId,
identity: { user_id: userId, provider },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying I should use the full userid or should I name it differently? If 2, any suggestion?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying I should use the full userid or should I name it differently? If 2, any suggestion?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as long as you are aware of the importance of the provider, you should be fine either way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants