-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the feature
Currently, the package supports only Google Auth. Apple is a very popular OS with many users using apple devices, support for Apple Auth is necessary.
Implementation
Extend the config to include apple in social
social: {
apple: {
clientId: 'your-apple-client-id',
redirectUri: 'http://localhost:3000/auth/apple/callback'
}
},const handleAppleSignIn = async () => {
try {
// Method 1: Direct OAuth with built-in flow
await initiateSocialLogin('apple', {
callbackUrl: '/dashboard'
})
// This will redirect to Apple OAuth
} catch (err) {
error.value = err.message || 'Google sign in failed'
}
}//src/runtime/composables/useAuth.ts
const initiateSocialLogin = async (provider: string, options: {
callbackUrl?: string
clientId?: string
redirectUri?: string
scopes?: string
state?: string
callbackPage?: string // New option to specify which page handles the OAuth callback
} = {}) => {
if (provider !== 'google' || provider !== 'apple') {
throw new Error(`Provider ${provider} is not supported`)
}//src/runtime/composables/useAuth.ts
const buildOAuthUrl = (provider: string, options: {
clientId?: string
redirectUri?: string
scopes?: string
state: string
}) => {
...
if (provider === 'apple') {
// handle build apple auth url
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request