为多个开发项目共用 GitHub 和 Google 登录。支持任意本机端口。
将模块放进你的应用并绑定登录按钮。回调可以使用任意本机端口。
import { startLogin, finishLogin } from './oauth.js';
const gateway = '';
const result = await finishLogin(gateway);
const button = document.getElementById('login');
button.onclick = () => startLogin(gateway, { provider: 'google' });
下载 oauth.js