Skip to content

Conversation

jjchen01
Copy link
Collaborator

  • Verify inviate

return nil, err
}
if userEntity != nil {
user = userEntity
Copy link
Contributor

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",
Copy link
Contributor

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"

Copy link
Collaborator Author

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() {

Copy link
Collaborator Author

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",
Copy link
Contributor

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

Copy link
Collaborator Author

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 {
Copy link
Contributor

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?

Copy link
Collaborator Author

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)
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

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.

Copy link
Contributor

@locnguyen1986 locnguyen1986 left a 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

@jjchen01 jjchen01 merged commit 1cd5b07 into main Sep 24, 2025
1 check passed
@jjchen01 jjchen01 deleted the feat/verify-invite-email branch September 24, 2025 10:31
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.

2 participants