# 在用户登录discourse时触发在外部服务上的账户创建/登录

**URL:** https://meta.discourse.org/t/triggering-account-creation-login-on-external-service-when-a-user-logs-in-on-discourse/340359
**Category:** Development
**Created:** [2024 年12 月 4 日 13:18 UTC](https://meta.discourse.org/t/triggering-account-creation-login-on-external-service-when-a-user-logs-in-on-discourse/340359 "2024-12-04T13:18:09Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### 作者： ![Chris\_Dawson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chris_dawson/32/184486_2.png) [@Chris\_Dawson](https://meta.discourse.org/u/Chris_Dawson)
#### 发布日期： [2024 年12 月 4 日 17:14 UTC](https://meta.discourse.org/t/triggering-account-creation-login-on-external-service-when-a-user-logs-in-on-discourse/340359/8 "2024-12-04T17:14:02Z")

</div>

太好了，我很期待阅读。我开始查看示例骨架插件 ([GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins](https://github.com/discourse/discourse-plugin-skeleton))，但有点失望，因为它完全没有文档。

乍一看，我需要问：本教程是否在 discourse 的基础 rails 安装中添加代码？如果这是官方方法，我没问题，但感觉这很危险，并且最好通过插件来处理（插件可以轻松卸载、禁用）。另外，我不用担心我的代码不在 github 仓库中，这会破坏 discourse 的升级吗？

例如在这里：

> [@Creating Routes in Discourse and Showing Data](https://meta.discourse.org/t/creating-routes-in-discourse-and-showing-data/48827?silent=true#p-216704-the-server-side-ruby-on-rails-2):
>
> Over time Discourse has grown in complexity and it can be daunting for beginners to understand how data gets all the way from the back end Ruby on Rails application to the Ember.js application in front. This tutorial is meant to show the full lifecycle of a request in Discourse and explain the steps necessary if you want to build a new page with its own URL in our application. URLs First I always prefer to start thinking of features in terms of the URLs to access them. For example let’s say we…

这是否意味着我真的要进入容器 (`./launcher enter app`)，然后编辑 `/var/www/app/controllers/snack_controller.rb`？

而且，我确实刚刚遵循了这些说明。即使运行 `./launcher rebuild app` 后，我也无法让 `/admin/snack.json` 路由正常工作。

本教程看起来已有大约八年历史。这真的是做事的正确方法吗？

---

_[View the full topic](https://meta.discourse.org/t/triggering-account-creation-login-on-external-service-when-a-user-logs-in-on-discourse/340359)._
