serverless-cd / ui

4 stars 11 forks source link

【auth-ui】Auth组件 #32

Closed heimanba closed 1 year ago

heimanba commented 1 year ago

UI页面

  1. serverless-cd现状 image

  2. 设计图 image

  3. 参考1 https://tailwindui.com/components/application-ui/forms/sign-in-forms

  4. 参考2 https://identity.netlify.com/

接口设计(初稿)

<Auth title={} 
    value={
       // 传统登录
        credentialProvider={
                credentials: {
                    username: {label: "username", type: "username"},
                    email: {label: "Email", type: "email"},
                    password: {label: "Password", type: "password"}
                },
                //  登录
                async signIn(credentials, req) {
                    return result;
                },
                // 注册
                async signUp(credentials, req) {
                    //  校验
                    return result;
                },
        },
        githubProvider: {
            url: 'https://github.com/login/oauth/authorize?client_id=86059a1b2bb20d3e5fc3&scope=repo,repo:status,delete_repo'
        },
        giteeProvider: {
            url: 'https://github.com/login/oauth/authorize?client_id=86059a1b2bb20d3e5fc3&scope=repo,repo:status,delete_repo'
        }
    }
    onChange=() => {}
>
</Auth>

技术推荐

  1. console-conponent
  2. react
heimanba commented 1 year ago

传统登录

登录流程

  1. 填写基本信息
  2. 校验
    • 前端校验
    • 后端校验 => /signin

注册流程

  1. 填写基本信息
  2. 校验
    • 后端校验 => / signup

      微信

      点击一个URL

heimanba commented 1 year ago

地址: https://github.com/serverless-cd/ui/tree/main/packages/auth-ui

heimanba commented 1 year ago

done