()
| 665 | } |
| 666 | |
| 667 | async function main() { |
| 668 | console.log('🔐 Direct Database SSO Registration Script (Better Auth Best Practice)') |
| 669 | console.log('====================================================================') |
| 670 | console.log('This script directly inserts SSO provider records into the database.') |
| 671 | console.log("It follows Better Auth's exact registerSSOProvider logic.\n") |
| 672 | |
| 673 | const success = await registerSSOProvider() |
| 674 | |
| 675 | if (success) { |
| 676 | console.log('🎉 SSO setup completed successfully!') |
| 677 | console.log() |
| 678 | console.log('Next steps:') |
| 679 | console.log('1. Configure the callback URL in your identity provider') |
| 680 | console.log('2. Restart your application if needed') |
| 681 | console.log('3. Users can now sign in with SSO!') |
| 682 | process.exit(0) |
| 683 | } else { |
| 684 | console.log('💥 SSO setup failed. Check the logs above for details.') |
| 685 | process.exit(1) |
| 686 | } |
| 687 | } |
| 688 | |
| 689 | main().catch((error) => { |
| 690 | logger.error('Script execution failed:', { error }) |
no test coverage detected