© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
say turn

Authentication not working

Hello,
Context
I was working on my project when I stumbled across a problem.
Supabase
Supabase
email authentication is not working, more specifically, the token in not being saved as it used to.

The problem
So previously, when a user signed in or signed up the session token used to be saved in browser's local storage (I didn't code it to, it saved itself automatically after authentication).
But not anymore, and I don't know the reason behind it.

supabase
supabase
sign up code in Next
export const signUp = async ({
    email,
    password,
}: {
    [key: string]: string;
}) => {
    const {
        data: { user },
        error,
    } = await supabase.auth.signUp({ email, password });
    if (error) {
        return Promise.reject(new Error("Signup error: Invalid credentials"));
    }
    return Promise.resolve(user);
};
export const signUp = async ({
    email,
    password,
}: {
    [key: string]: string;
}) => {
    const {
        data: { user },
        error,
    } = await supabase.auth.signUp({ email, password });
    if (error) {
        return Promise.reject(new Error("Signup error: Invalid credentials"));
    }
    return Promise.resolve(user);
};


sign up form event in Next
const onCreateUser = (e: React.FormEvent<HTMLFormElement>) => {
        e.preventDefault();
        setLoading(true);
        signUp({ email, password })
            .then((user) => router.replace("/explore"))
            .catch((err) => setError(true))
            .finally(() => setLoading(false));
    };
const onCreateUser = (e: React.FormEvent<HTMLFormElement>) => {
        e.preventDefault();
        setLoading(true);
        signUp({ email, password })
            .then((user) => router.replace("/explore"))
            .catch((err) => setError(true))
            .finally(() => setLoading(false));
    };


Q1. What version of Next and Supabase am I using?
Ans -
Next 13.0.5
Next 13.0.5
and
Supabase v2
Supabase v2
. The previous working code was on the same version as well.

Q2. Did you update/change your previously working code?
Ans - No, it's the same piece of code that used to work.

Q3. Time gap between the working and non-working version?
Ans - a week and a half. Two week before today.

I will be happy to answer any more queries, and appreciate anyone that helps. Thanks!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Queue authentication suddenly not working?
SupabaseSSupabase / help-and-questions
14mo ago
Facebook provider authentication not working
SupabaseSSupabase / help-and-questions
3y ago
React authentication not working as expected
SupabaseSSupabase / help-and-questions
4y ago
Supabase Authentication users create is not working
SupabaseSSupabase / help-and-questions
13mo ago