Menu

Supabase email sign-in and a profiles table for iOS, done safely
📰

Supabase email sign-in and a profiles table for iOS, done safely

DEV Community: ios·Robert Long·1 day ago
#vrvprcSX
#devtoios#devto#dev#profiles#auth
Reading 0:00
15s threshold

Almost every iOS app I start needs the same first hour of work: email sign-in, a place to keep per-user data, and a way to make sure users can only touch their own rows. Supabase gives you most of it. The part people get wrong is the profiles table , because the obvious version is also the insecure one.

This post walks through the setup I use: the SQL, the Swift, and the three mistakes to avoid. It assumes you know basic SwiftUI and have a free Supabase project.

The model: two tables, one id

Supabase Auth stores credentials in auth.users . You don't add your own columns there. Instead you create a public.profiles table whose primary key is the auth user's id:

create table if not exists public . profiles ( id uuid primary key references auth .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.