bug: "Login on web" button not shown when only Nextcloud login provider is configured

未关闭 适合新手
#7,982 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
react-native, typescript
领域
mobile

调研方向

从 app/lib/services/connect.ts 中的 getLoginServices 和 app/containers/LoginServices/index.tsx 中的回退检查开始。追踪带有 hideButtonOnMobile: true 的不受支持 OAuth 服务如何处理,然后检查 Nextcloud 是唯一提供方时登录屏幕的行为。对于此配置,应用显示“Login on web”即表示完成;issue 没有指定测试文件。

由索引模型根据 Issue 内容生成。

描述

🐛 bug type: bug
Describe the Bug

The only external login on our workspace is the built-in Nextcloud OAuth provider. The default login form is disabled. In the mobile app, the login screen shows no login option at all, only "New user registration is currently disabled". The "Login on web" does not appear, so users can't log in from the app.

Login through the same provider works fine in the web client.

Steps to Reproduce
  1. On a Rocket.Chat 9.x server, enable the built-in Nextcloud OAuth provider (Administration → Settings → OAuth → Nextcloud) and make sure no other OAuth provider is enabled (no Custom OAuth, Google, GitHub, etc.).
  2. Disable the default login form (Accounts_ShowFormLogin = false).
  3. Set registration to disabled (Accounts_RegistrationForm = Disabled).
  4. Check that GET /api/v1/settings.oauth returns only the nextcloud service with hideButtonOnMobile: true.
  5. Open the Rocket.Chat mobile app (4.79.0) and add the workspace.
  6. Look at the login screen.
Expected Behavior

"Login on web" should also appear when the server returns OAuth services that the app does not support natively. Since 9.0, all OAuth logins use the server-side flow, so the web login can handle any provider.

Actual Behavior

The login screen shows only the workspace name, the URL and the text "New user registration is currently disabled". There is no Nextcloud button, no "Login on web" button and no login form, so users have no way to log in from the app.

In the web client, the same workspace shows the Nextcloud button and the login works as expected.

If a Custom OAuth provider is enabled as well, the "Login on web" button appears in the app. The web page it opens shows the Nextcloud button, and the login through Nextcloud completes successfully in the app.

Rocket.Chat Server Version

9.x.x

Rocket.Chat App Version

4.79.0 (110274)

Device Name

iPhone 16

OS Version

iOS 27.2.1

Additional Context

Root cause (from source)

  1. getLoginServices drops every service that determineAuthType classifies as not_supported. nextcloud is not in availableOAuth, so the service is removed from state.login.services:

  2. LoginServices only shows "Login on web" if a service that is still in that list has hideButtonOnMobile: true. Services that were already dropped don't count:

So a workspace whose providers are all unsupported never gets the "Login on web" fallback.

Workaround / confirmation

If we also enable a Custom OAuth provider (which is kept as oauth_custom and hidden because of hideButtonOnMobile: true), "Login on web" appears. The web page it opens shows the Nextcloud button, and the login completes successfully in the app. This only works with a Premium license, since Custom OAuth is premium-only from 9.0.

主要语言
TypeScript
星标
2.4k
派生
1.5k
平均合并
5 天 16 小时
30 天内合并 PR
38

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

RocketChat/Rocket.Chat.ReactNative 的其他 Issue

查看 RocketChat/Rocket.Chat.ReactNative 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。