Skip to content

Commit

Permalink
feat(doc): update authing doc/weibo doc
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhuapiaoyuan committed Oct 21, 2024
1 parent 8d4ef3b commit 5e473ee
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 14 deletions.
36 changes: 22 additions & 14 deletions apps/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
cacheDir: './.vitepress/.vite' ,
cacheDir: './.vitepress/.vite',
srcDir: '.',
base:"/next-auth-oauth/",
title: "🚀next-auth-oauth,一键启动完善登录套件的Nextjs应用 🔐",
lastUpdated: true ,
description: "next-auth-oauth,一款符合中国国情的第三方登录集成方案",
base: '/next-auth-oauth/',
title: '🚀next-auth-oauth,一键启动完善登录套件的Nextjs应用 🔐',
lastUpdated: true,
description: 'next-auth-oauth,一款符合中国国情的第三方登录集成方案',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: '主页', link: '/' },
{ text: '快速启动', link: '/quickstart' },
{ text: '文档', link: '/markdown-examples' }
{ text: '文档', link: '/markdown-examples' },
],
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2024-present Nextjs.Boy'
copyright: 'Copyright © 2024-present Nextjs.Boy',
},

sidebar: [
Expand All @@ -29,20 +29,28 @@ export default defineConfig({
{ text: '微信网页登录', link: '/wehcat-web' },
{ text: '公众号-验证码登录', link: '/wechatmp-captcha' },
{ text: '公众号-场景二维码登录', link: '/wechatmp-qrcode' },
{ text: 'Gitee登录', link: '/gitee' }
]
{ text: 'Gitee登录', link: '/gitee' },
{ text: 'Authing登录', link: '/authing' },
{ text: 'Weibo登录', link: '/weibo' },
],
},
{
text: '其他',
items: [
{ text: 'Next.js 我该怎么爱你?', link: '/nextjs-fuck' },
{ text: '适合中国宝宝体质的第三方登录流程', link: '/chinese-third-party-login-flow' },
]
{
text: '适合中国宝宝体质的第三方登录流程',
link: '/chinese-third-party-login-flow',
},
],
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/liuhuapiaoyuan/next-auth-oauth' }
]
}
{
icon: 'github',
link: 'https://github.com/liuhuapiaoyuan/next-auth-oauth',
},
],
},
})
38 changes: 38 additions & 0 deletions apps/docs/authing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
outline: deep
---

# 使用Authing实现小程序登录

> 使用 Authing 快速实现任何 Web、App 和企业软件的身份认证和用户管理, 为你的客户和员工提供完善的登录解决方案
[Authing](https://www.authing.cn/)

## 1. 注册Authing账号,并配置应用

## 2. 配置应用>身份源管理>社会化身份源

![支持多种不同的身份源](static/authing.png)

## 3. 配置`next-auth`

```typescript
import NextAuth from 'next-auth'
import { Authing } from 'next-auth-oauth'

export default NextAuth({
providers: [Authing],
})
```

## 3. 配置`Authing`的环境变量,修改`.env`文件

```
AUTH_AUTHING_ID=下图中的APPID
AUTH_AUTHING_SECRET=下图中的APP SECRET
AUTH_AUTHING_DOMAIN= 下图中的认证配置->认证地址
```

**由于认证配置-认证地址可以自定义,所以每个人会不一样,一定要注意**

![应用配置](static/authing_config.png)
Binary file added apps/docs/static/authing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/static/authing_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions apps/docs/weibo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
outline: deep
---

# 使用微博登录

> 支持微博登录
## 1. 注册微博开发者账号

## 2. 创建应用

## 3. 配置`next-auth`

```typescript
import NextAuth from 'next-auth'
import Weibo from '@next-auth-oauth/weibo'

export default NextAuth({
providers: [Weibo],
})
```

## 3. 配置`Weibo`的环境变量,修改`.env`文件

```
AUTH_WEIBO_ID=APPID
AUTH_WEIBO_SECRET=
```

0 comments on commit 5e473ee

Please sign in to comment.