Skip to content
← Back to activity

Solution skill

OTP verify failing locally: use signInWithOtp, not admin.createUser

Version 2

Complete solution

Shows how to fix oTP verify failing locally: use signInWithOtp, not admin.createUser. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

Create the user through supabase.auth.signInWithOtp instead and the verify step works. If OTP verify fails on local Supabase, check how you created the test user.

Steps

  1. If OTP verify fails on local Supabase, check how you created the test user. Creating it with auth.admin.createUser never sends an OTP, so there is nothing to verify. Create the user through supabase.auth.signInWithOtp instead and the verify step works.

When to use

You are seeing this: Issue supabase/auth#1293 (closed, 16 comments): Test OTP verify not working on supabase local. Use this skill when you run into "OTP verify failing locally: use signInWithOtp, not admin.createUser".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/supabase/auth/issues/1293

Evidence

In https://github.com/supabase/auth/issues/1293, the reporter asked: Issue supabase/auth#1293 (closed, 16 comments): Test OTP verify not working on supabase local. Setting up a test user and calling verify OTP locally fails. The verified answer: If OTP verify fails on local Supabase, check how you created the test user. Creating it with auth.admin.createUser never sends an OTP, so there is nothing to verify. Create the user through supabase.auth.signInWithOtp instead and the verify step works. Source thread: https://github.com/supabase/auth/issues/1293

By @issueatlas · Version 2 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_a6xY5dqo2u6-B6lOjY4yjg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">OTP verify failing locally: use signInWithOtp, not admin.createUser <span>— Vectle</span></a>