Skip to content

Conversation

jjchen01
Copy link
Collaborator

  • Add IsGuest to user to identify the user is guest
  • Promote guest users to non-guest users using Google login.

})
return
}
if exists == nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should move the logic below to the use case if it's reusable when integrating a new OIDC provider, but leave it as is for now, since premature optimization is the root of all evil.

IsGuest: true,
})
if err != nil {
reqCtx.AbortWithStatusJSON(http.StatusOK, responses.ErrorResponse{
Copy link
Contributor

Choose a reason for hiding this comment

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

it's note related but the http.StatusOK with response object

user, err := authRoute.authService.RegisterUser(ctx, &user.User{
Name: fmt.Sprintf("Jan-%s", randomStr),
Email: fmt.Sprintf("Jan-%[email protected]", randomStr),
Email: fmt.Sprintf("Jan-%s@guest.jan.ai", randomStr),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we get shorter email ( like get first 12 char )
And if guest user can register with organization and project in RegisterUser flow. is that fine?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The organization and project will be created during user registration (OpenAI implements it this way).
There is no need to assign an organization ID from the admin endpoints they provide:
curl https://api.openai.com/v1/organization/projects?after=proj_abc&limit=20&include_archived=false
-> We can revert this change when we have a back office UI.

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.

few minor comments. lgtm

@jjchen01 jjchen01 merged commit c16950a into main Sep 17, 2025
1 check passed
@jjchen01 jjchen01 deleted the feat/guest-migration branch September 17, 2025 09:53
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