m0nq / cloud-people

https://cloud-people.vercel.app
0 stars 0 forks source link

Implement Apple Authentication #77

Open m0nq opened 1 week ago

m0nq commented 1 week ago

Implement authentication via Apple using Supabase. This will allow users to log in using their Apple accounts, enhancing user convenience and security.

Tasks

  1. Configure Supabase for OAuth Providers
    • Enable Apple as external OAuth providers in the Supabase login.
    • Obtain necessary credentials (Client ID, Client Secret) from Apple and Google developer consoles.
    • Update Supabase configuration with these credentials.
  2. Update Supabase Configuration
    • Modify the `config.toml` file or use environment variables to enable Apple and Google providers:
[auth.external.apple]
enabled = true
client_id = "YOUR_APPLE_CLIENT_ID"
secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)"

[auth.external.google]
enabled = true
client_id = "YOUR_GOOGLE_CLIENT_ID"
secret = "env(SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET)"
  1. Update authentication logic to include sign-in with Apple
import { createClient } from '@supabase/supabase-js';

const supabase = createClient('https://your-supabase-url.supabase.co', 'public-anon-key');

export const signInWithProvider = async (provider) => {
  const { user, session, error } = await supabase.auth.signInWithOAuth({ provider });
  if (error) console.error('Error signing in:', error);
  return { user, session };
};

Acceptance Criteria

Additional Notes

linear[bot] commented 1 week ago

DEV-82 Implement Apple Authentication