-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/verify invite email #175
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
Conversation
jjchen01
commented
Sep 24, 2025
- Verify inviate
return nil, err | ||
} | ||
if userEntity != nil { | ||
user = userEntity |
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.
this line can be removed
}) | ||
if err != nil || inviteEntity == nil { | ||
reqCtx.AbortWithStatusJSON(http.StatusBadRequest, responses.ErrorResponse{ | ||
Code: "dc9e8394-2c28-40c9-93e1-7878f67992c4", |
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.
we may return the message to user here:
Like: "code not found" "code is expired"
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.
returned in:
if inviteEntity.IsExpired() {
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.
Invalid status for
if err != nil || inviteEntity == nil {
} | ||
|
||
owner, err := api.authService.FindOrRegisterUser(ctx, &user.User{ | ||
Name: "Admin", |
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.
can we have a better name? :D like "normal user" :D :D
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.
Or use the guest name, but if the user logs in with the proper OIDC provider, we will replace it. In most cases, they won't see the Admin.
projects, err := api.projectService.Find(ctx, project.ProjectFilter{ | ||
PublicIDs: &projectPublicIDs, | ||
}, nil) | ||
if err != nil { |
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 question here, if error thrown, can user click the invite link again?
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.
Yes, the error is a server error and will be rolled back.
|
||
func (inviteRoute *InvitesRoute) RegisterRouter(router gin.IRouter) { | ||
// public router | ||
router.POST("/invites/verification", inviteRoute.VerifyInvites) |
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.
put the invite url here seem weird
I think /v1/invites/verification is good.
No need to map with organization 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.
It's the invitation to the organization.
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.
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.
Add the missing organization logic above.
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.
added comment, feel free to merge after addressing