- Go to GitHub Settings
- Click "New OAuth App"
- Fill in the application details:
Application name: PacMac Mobile Admin
Homepage URL:
https://your-domain.com
Application description: Admin portal for PacMac Mobile inventory management
Authorization callback URL:
https://your-domain.com
After creating the OAuth app, you'll get:
- Client ID (public)
- Client Secret (keep this secure!)
Replace the placeholder values in the index.html file:
this.githubClientId = 'your-actual-github-client-id-here';Note: For security, the client secret should be handled server-side in production. For this simple setup, you can temporarily include it in the code, but consider using a backend service for production use.
- Open your
index.htmlfile in a browser - Click "Log in with GitHub"
- Complete the GitHub OAuth flow
- You should see the admin interface after successful authentication
- ✅ GitHub OAuth authentication
- ✅ User session persistence (stored in localStorage)
- ✅ Protected admin interface (hidden until authenticated)
- ✅ User info display (name, email, avatar)
- ✅ Logout functionality
- ✅ Automatic re-authentication on page reload
- User data is stored in localStorage (client-side only)
- No server-side authentication required
- Perfect for simple admin interfaces
- GitHub OAuth tokens are handled securely
- Make sure your domain is added to the callback URL
- Check browser console for any JavaScript errors
- Ensure your GitHub OAuth app is properly configured
- Verify your Client ID is correct
- Make sure the callback URL matches exactly