Skip to content

feat(login): show a sign-in button for each login-method plugin feature - #1512

Draft
Foowy wants to merge 2 commits into
ShokoAnime:masterfrom
Foowy:feat/login-methods
Draft

Foowy wants to merge 2 commits into
ShokoAnime:masterfrom
Foowy:feat/login-methods

Conversation

@Foowy

@Foowy Foowy commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a sign-in button to the login page for each plugin that advertises a login-method feature, so plugin-provided sign-in (for example OIDC/SSO) can be offered without a WebUI change per plugin.

Draft: the login-method feature contract below is a proposal and I would like feedback on it before it settles.

Changes

  • LoginPage.tsx: shows an "or" divider and a "Sign in with {displayName}" button under Login for every login method. Clicking it navigates the browser to the plugin's loginUrl, passing the current redirectTo as returnUrl.
  • src/core/utilities/loginMethods.ts: picks the anonymous login-method features out of the feature list and validates them. Only a loginUrl that is a path on the same server is accepted (no absolute urls, //host, backslashes or other schemes), since it comes from plugin metadata.
  • plugin/queries.ts, types/api/plugin.ts: usePluginFeaturesQuery for GET Plugin/Features and the PluginFeatureType type. The query only runs once the server is Started.
  • tests/core/utilities/loginMethods.test.ts: covers the filtering, the rejected urls and the returnUrl handling.

Proposed contract

An anonymous plugin feature named login-method with metadata:

  • displayName: text for the button
  • loginUrl: a path on this server that starts the sign-in and ends by sending the browser to returnUrl (default /webui) with a session stored in sessionStorage.state.apiSession

A plugin that implements it is Foowy/Shoko.Plugin.Oidc.

Checked in a headless browser against a build of this branch and that plugin: the button shows on the login page, signs in through an external provider and lands on the dashboard with a session.

login

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant