DEV Community

Beaver Bridge
Beaver Bridge

Posted on

Supabase의 auth.users의 encrypted_password 만드는 방법

select crypt('new_password', gen_salt('bf', 10))
-- 결과는 계속 바뀜
-- $2a$10$uz6Q8eG9pQVPWHVBVUvkauH5gJazJ19VMsJL9.Vf5Pmq1JSlwbIaO
Enter fullscreen mode Exit fullscreen mode

결과의 $10 부분이 gen_salt에 들어가는 10 이 된다. 저 숫자를 12로 바꾸면 $2a$12로 시작한다.

sql로 auth.users 에 넣으려면 이렇게 하면 된다.

update auth.users 
set encrypted_password = crypt('new_password', gen_salt('bf', 10)) 
where id  = '2b1741a5-c454-4ac7-9ef6-46c6c857cd9d'
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay