diff --git a/authentik/core/types.py b/authentik/core/types.py index a10be69bb..892f58e7e 100644 --- a/authentik/core/types.py +++ b/authentik/core/types.py @@ -29,3 +29,4 @@ class UserSettingSerializer(PassiveSerializer): component = CharField() title = CharField() configure_url = CharField(required=False) + icon_url = CharField() diff --git a/authentik/sources/oauth/models.py b/authentik/sources/oauth/models.py index dfbb8f5a0..de7156442 100644 --- a/authentik/sources/oauth/models.py +++ b/authentik/sources/oauth/models.py @@ -75,14 +75,17 @@ class OAuthSource(Source): ) def ui_user_settings(self) -> Optional[UserSettingSerializer]: + provider_type = self.type + provider = provider_type() return UserSettingSerializer( data={ - "title": f"OAuth {self.name}", + "title": self.name, "component": "ak-user-settings-source-oauth", "configure_url": reverse( "authentik_sources_oauth:oauth-client-login", kwargs={"source_slug": self.slug}, ), + "icon_url": provider.icon_url(), } ) diff --git a/authentik/sources/plex/models.py b/authentik/sources/plex/models.py index c16fd28dd..734f7fefa 100644 --- a/authentik/sources/plex/models.py +++ b/authentik/sources/plex/models.py @@ -80,9 +80,10 @@ class PlexSource(Source): def ui_user_settings(self) -> Optional[UserSettingSerializer]: return UserSettingSerializer( data={ - "title": f"Plex {self.name}", + "title": self.name, "component": "ak-user-settings-source-plex", "configure_url": self.client_id, + "icon_url": static("authentik/sources/plex.svg"), } ) diff --git a/schema.yml b/schema.yml index e48e8fe8c..9d8a463d4 100644 --- a/schema.yml +++ b/schema.yml @@ -31275,8 +31275,11 @@ components: type: string configure_url: type: string + icon_url: + type: string required: - component + - icon_url - object_uid - title UserSourceConnection: diff --git a/web/src/authentik.css b/web/src/authentik.css index 1467a7e27..ce62eb54c 100644 --- a/web/src/authentik.css +++ b/web/src/authentik.css @@ -339,9 +339,16 @@ html > form > input { ) !important; } /* data list */ + .pf-c-data-list { + border-top-color: var(--ak-dark-background-lighter); + } .pf-c-data-list__item { - --pf-c-data-list__item--BackgroundColor: var(--ak-dark-background-light); + --pf-c-data-list__item--BackgroundColor: transparent; --pf-c-data-list__item--BorderBottomColor: var(--ak-dark-background-lighter); color: var(--ak-dark-foreground); } } + +.pf-c-data-list__item { + background-color: transparent; +} diff --git a/web/src/flows/stages/identification/IdentificationStage.ts b/web/src/flows/stages/identification/IdentificationStage.ts index 4b1447bc2..841aa9b06 100644 --- a/web/src/flows/stages/identification/IdentificationStage.ts +++ b/web/src/flows/stages/identification/IdentificationStage.ts @@ -168,13 +168,13 @@ export class IdentificationStage extends BaseStage< } return html``; + return html`
+

+ ${t`Connect your user account to the services listed below, to allow you to login using the service instead of traditional credentials.`} +

+
+ `; } } diff --git a/web/src/user/user-settings/sources/SourceSettingsOAuth.ts b/web/src/user/user-settings/sources/SourceSettingsOAuth.ts index 9106ace70..fdae22b28 100644 --- a/web/src/user/user-settings/sources/SourceSettingsOAuth.ts +++ b/web/src/user/user-settings/sources/SourceSettingsOAuth.ts @@ -16,13 +16,6 @@ export class SourceSettingsOAuth extends BaseUserSettings { title!: string; render(): TemplateResult { - return html`
-
${t`Source ${this.title}`}
-
${this.renderInner()}
-
`; - } - - renderInner(): TemplateResult { return html`${until( new SourcesApi(DEFAULT_CONFIG) .sourcesUserConnectionsOauthList({ @@ -30,29 +23,27 @@ export class SourceSettingsOAuth extends BaseUserSettings { }) .then((connection) => { if (connection.results.length > 0) { - return html`

${t`Connected.`}

- `; - } - return html`

${t`Not connected.`}

- { + return new SourcesApi( + DEFAULT_CONFIG, + ).sourcesUserConnectionsOauthDestroy({ + id: connection.results[0].pk || 0, + }); + }} > - ${t`Connect`} - `; + ${t`Disconnect`} + `; + } + return html` + ${t`Connect`} + `; }), )}`; } diff --git a/web/src/user/user-settings/sources/SourceSettingsPlex.ts b/web/src/user/user-settings/sources/SourceSettingsPlex.ts index 16d03e368..064e58a1d 100644 --- a/web/src/user/user-settings/sources/SourceSettingsPlex.ts +++ b/web/src/user/user-settings/sources/SourceSettingsPlex.ts @@ -16,13 +16,6 @@ export class SourceSettingsPlex extends BaseUserSettings { @property() title!: string; - render(): TemplateResult { - return html`
-
${t`Source ${this.title}`}
-
${this.renderInner()}
-
`; - } - async doPlex(): Promise { const authInfo = await PlexAPIClient.getPin(this.configureUrl || ""); const authWindow = popupCenterScreen(authInfo.authUrl, "plex auth", 550, 700); @@ -43,7 +36,7 @@ export class SourceSettingsPlex extends BaseUserSettings { ); } - renderInner(): TemplateResult { + render(): TemplateResult { return html`${until( new SourcesApi(DEFAULT_CONFIG) .sourcesUserConnectionsPlexList({ @@ -51,24 +44,22 @@ export class SourceSettingsPlex extends BaseUserSettings { }) .then((connection) => { if (connection.results.length > 0) { - return html`

${t`Connected.`}

- `; - } - return html`

${t`Not connected.`}

- `; + } + return html` `; }), )}`; }