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

Add user management script with Supabase admin methods #4

Merged
merged 2 commits into from
May 15, 2023

Conversation

DieHard073055
Copy link
Owner

This commit introduces a new file, users.js, which implements user management functions using Supabase's admin methods. The script includes functionality to:

  • Create a new user with an email and password, automatically confirming the email.
  • Sign in a user using their email and password.
  • Delete a user based on their user ID.

These functions are tested in sequence to ensure that user creation, login, and deletion processes work as expected.

Environment variables for the Supabase URL and service role key are loaded from a .env file for secure access to the Supabase client.

Note: This script uses the service role key and should therefore be run in a secure server environment, and never in the client-side/browser environment.

This commit introduces a new file, users.js, which implements user management functions using Supabase's admin methods. The script includes functionality to:

- Create a new user with an email and password, automatically confirming the email.
- Sign in a user using their email and password.
- Delete a user based on their user ID.

These functions are tested in sequence to ensure that user creation, login, and deletion processes work as expected.

Environment variables for the Supabase URL and service role key are loaded from a .env file for secure access to the Supabase client.

Note: This script uses the service role key and should therefore be run in a secure server environment, and never in the client-side/browser environment.
@DieHard073055 DieHard073055 requested a review from pamdayne May 14, 2023 16:10
@DieHard073055 DieHard073055 linked an issue May 14, 2023 that may be closed by this pull request
Copy link
Collaborator

@pamdayne pamdayne left a comment

Choose a reason for hiding this comment

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

Seems good to me

@DieHard073055 DieHard073055 merged commit dec1e5b into main May 15, 2023
@DieHard073055 DieHard073055 deleted the 3-add-user-management-examples-to-repository branch May 15, 2023 15:12
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.

Add User Management Examples to Repository
2 participants