mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-28 19:02:03 +08:00
feat(oauth2): add SVG icon support for OAuth2 providers (#825)
- Add optional `icon` field to UserOauth2Settings type - Include preset SVG icons for GitHub, Linux Do, and Authentik templates - Render icons on OAuth2 login buttons - Add icon configuration UI with preview in admin panel Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -146,6 +146,7 @@ export class WebhookSettings {
|
||||
|
||||
export type UserOauth2Settings = {
|
||||
name: string;
|
||||
icon?: string; // SVG icon string for the provider
|
||||
clientID: string;
|
||||
clientSecret: string;
|
||||
authorizationURL: string;
|
||||
|
||||
@@ -11,13 +11,14 @@ export default {
|
||||
openSettings: async (c: Context<HonoCustomType>) => {
|
||||
const value = await getJsonSetting(c, CONSTANTS.USER_SETTINGS_KEY);
|
||||
const settings = new UserSettings(value);
|
||||
const oauth2ClientIDs = [] as { clientID: string, name: string }[];
|
||||
const oauth2ClientIDs = [] as { clientID: string, name: string, icon?: string }[];
|
||||
try {
|
||||
const oauth2Settings = await getJsonSetting<UserOauth2Settings[]>(c, CONSTANTS.OAUTH2_SETTINGS_KEY);
|
||||
oauth2ClientIDs.push(
|
||||
...oauth2Settings?.map(s => ({
|
||||
clientID: s.clientID,
|
||||
name: s.name
|
||||
name: s.name,
|
||||
icon: s.icon,
|
||||
})) || []
|
||||
);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user