Skip to content

Commit

Permalink
docs: add oauth doc
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan32 committed Oct 8, 2022
1 parent 297ada5 commit 42e4b4d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 1 deletion.
Binary file added docs/simple-admin/assets/oauth_add_provider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/simple-admin/en/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
* [Swagger](simple-admin/en/docs/swagger.md)
* [GORM](simple-admin/en/docs/gorm.md)
* [Authorization](simple-admin/en/docs/authorization.md)
* [Error Handling](simple-admin/en/docs/error_handling.md)
* [Error Handling](simple-admin/en/docs/error_handling.md)
* [Oauth](simple-admin/en/docs/oauth.md)
25 changes: 25 additions & 0 deletions docs/simple-admin/en/docs/oauth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Oauth

## The system offer google and github Oauth log in by default

### How to get clientID and client secret?
[google](https://developers.google.com/identity/protocols/oauth2)
[github](https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps)

### Add provider

![picture](../../assets/oauth_add_provider_en.png)

### Edit src/views/sys/login/LoginForm.vue

```html
<div class="flex justify-evenly enter-x" :class="`${prefixCls}-sign-in-way`">
<GithubFilled @click="oauthLoginHandler('github')" />
<WechatFilled />
<AlipayCircleFilled />
<GoogleCircleFilled @click="oauthLoginHandler('google')" />
<TwitterCircleFilled />
</div>
```

Add icon and click event with the provider name。
1 change: 1 addition & 0 deletions docs/simple-admin/zh-cn/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
* [GORM](simple-admin/zh-cn/docs/gorm.md)
* [权限验证](simple-admin/zh-cn/docs/authorization.md)
* [错误处理](simple-admin/zh-cn/docs/error_handling.md)
* [第三方登录](simple-admin/zh-cn/docs/oauth.md)
* [常见问题](simple-admin/zh-cn/docs/FAQ.md)
25 changes: 25 additions & 0 deletions docs/simple-admin/zh-cn/docs/oauth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Oauth

## 目前系统已默认提供 google 和 github Oauth 登录功能

### 如何获取 clientID 和 client secret?
[google](https://developers.google.com/identity/protocols/oauth2)
[github](https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps)

### 添加第三方

![picture](../../assets/oauth_add_provider.png)

### 编辑 src/views/sys/login/LoginForm.vue

```html
<div class="flex justify-evenly enter-x" :class="`${prefixCls}-sign-in-way`">
<GithubFilled @click="oauthLoginHandler('github')" />
<WechatFilled />
<AlipayCircleFilled />
<GoogleCircleFilled @click="oauthLoginHandler('google')" />
<TwitterCircleFilled />
</div>
```

添加对应的provider名称即可。

0 comments on commit 42e4b4d

Please sign in to comment.