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(core): set user default roles from env #1793

Merged
merged 3 commits into from
Aug 19, 2022
Merged

Conversation

gao-sun
Copy link
Member

@gao-sun gao-sun commented Aug 18, 2022

Summary

  • set env USER_DEFAULT_ROLE_NAMES to add default roles when inserting a new user
  • remove original insertUser query, replace with insertUser lib function

Testing

  • no USER_DEFAULT_ROLE_NAMES, no role name for new users
  • USER_DEFAULT_ROLE_NAMES=user,good_user, user has role names ["user", "good_user"] with new roles created

image

@github-actions
Copy link

github-actions bot commented Aug 18, 2022

COMPARE TO master

Total Size Diff 📈 +524 Bytes

Diff by File
Name Diff
packages/core/src/env-set/index.ts 📈 +32 Bytes
packages/core/src/lib/user.ts 📈 +1.09 KB
packages/core/src/queries/roles.ts 📈 +269 Bytes
packages/core/src/queries/user.test.ts 📈 +805 Bytes
packages/core/src/queries/user.ts 📈 +93 Bytes
packages/core/src/routes/admin-user.test.ts 0 Bytes
packages/core/src/routes/admin-user.ts 📈 +2 Bytes
packages/core/src/routes/session/passwordless.test.ts 📈 +3 Bytes
packages/core/src/routes/session/passwordless.ts 📈 +2 Bytes
packages/core/src/routes/session/session.test.ts 📈 +1 Bytes
packages/core/src/routes/session/session.ts 📈 +2 Bytes
packages/core/src/routes/session/social.test.ts 📈 +3 Bytes
packages/core/src/routes/session/social.ts 📈 +2 Bytes

@gao-sun gao-sun marked this pull request as ready for review August 19, 2022 05:44
@github-actions github-actions bot added size/m and removed size/s labels Aug 19, 2022
Copy link
Contributor

@wangsijie wangsijie left a comment

Choose a reason for hiding this comment

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

LGTM

@gao-sun gao-sun merged commit 4afdf3c into master Aug 19, 2022
@gao-sun gao-sun deleted the gao-add-default-roles-env branch August 19, 2022 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants