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: save user info from google #1254

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft

feat: save user info from google #1254

wants to merge 24 commits into from

Conversation

Ubisoft-potato
Copy link
Collaborator

@Ubisoft-potato Ubisoft-potato commented Sep 23, 2024

This PR will add first_name, last_name and avatar columns to account_v2 table and save them from Google account while user login via Google for the first time.

Key changes:

  • Refactor generateToken method in auth module. [1]
  • Add update user info method that save them from Google. [1]
  • Add update user last seen timestamp method after generate token. [1]

Other changes

  • Update account e2e test. [1]
  • Add account_v2 table migration file. [1]

@Ubisoft-potato Ubisoft-potato marked this pull request as ready for review September 23, 2024 15:52
@Ubisoft-potato Ubisoft-potato marked this pull request as draft September 23, 2024 15:53
@@ -289,3 +297,12 @@ func (s *accountStorage) ListAccountsV2(
}
return accounts, nextOffset, totalCount, nil
}

func (s *accountStorage) IsNewUser(ctx context.Context, email string) (bool, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding a new interface, please use GetAccount and check the NotFound error to maintain consistency with the other places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GetAccountV2(ctx context.Context, email, organizationID string)

GetAccountV2 need organizationId param, we don't need it when check if a use if new registration

@Ubisoft-potato Ubisoft-potato changed the title feat: new user registration feat: save user info from google Oct 21, 2024
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