@htmlbricks/hb-auth-social-login-button 0.66.7 → 0.66.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ ## `hb-auth-social-login-button` — auth-social-login-button
2
+
3
+ **Category:** auth | **Tags:** auth, oauth
4
+
5
+ ### What it does
6
+
7
+ Clickable OAuth provider tile (default SVGs for Google, GitHub, GitLab, Facebook, Authentik; overridable via slot). Builds the provider authorization URL from `provider` params or uses a prebuilt `url`, then parses the return URL to exchange code/token with `simple-serverless-auth-client` when `social_auth_server_url` and `auth_cookie_name` are set. Emits `oauthFlowInit`, `oauthFlowSuccess`, or `oauthFlowCustom` for custom flows.
8
+
9
+ ### Custom element
10
+
11
+ `hb-auth-social-login-button`
12
+
13
+ ### Attributes / props (snake_case)
14
+
15
+ | Property | Type | Notes |
16
+ | --- | --- | --- |
17
+ | `id` | string (optional) | Element identifier. |
18
+ | `style` | string (optional) | Inline style string. |
19
+ | `social_auth_server_url` | string (optional) | Server URL for token exchange. |
20
+ | `auth_cookie_name` | string (optional) | Cookie name used by the auth client. |
21
+ | `redirectonlogin` | string (optional) | Post-login redirect. |
22
+ | `provider` | object (optional) | JSON: `{ url?: string; name: "facebook" \| "google" \| "gitlab" \| "github" \| "authentik"; params?: { redirect_url; client_id; scope; auth_server_url? } }`. |
23
+
24
+ **Slots:** `header`. **i18n:** Italian and English in metadata.
25
+
26
+ ### Events (`CustomEvent` names)
27
+
28
+ - **`oauthFlowSuccess`** — `{ token: string }`
29
+ - **`oauthFlowInit`** — `{ token?: string; provider: IProvider; tmpCode?: string; redirect_uri?: string }` (`IProvider` = facebook \| google \| gitlab \| github \| authentik)
30
+ - **`oauthFlowCustom`** — `{ provider: IProvider }`
31
+
32
+ ### Usage notes
33
+
34
+ - Bootstrap 5 theme variables (`--bs-*`) apply to layout/button styling.
35
+ - Provider artwork aligns with common OAuth brands; slot `header` can override presentation.
36
+ - Shadow DOM encapsulates default SVGs; configure via attributes and slots.
37
+ - Use `i18nlang` on parent `hb-auth` or this component’s i18n metadata where wired.
38
+
39
+ ### Minimal HTML example
40
+
41
+ ```html
42
+ <hb-auth-social-login-button
43
+ provider='{"name":"google","url":"https://accounts.google.com/o/oauth2/v2/auth?..."}'
44
+ social_auth_server_url="https://auth.example.com"
45
+ auth_cookie_name="session"
46
+ ></hb-auth-social-login-button>
47
+ ```
package/manifest.json CHANGED
@@ -242,5 +242,5 @@
242
242
  },
243
243
  "iifePath": "main.iife.js",
244
244
  "repoName": "@htmlbricks/hb-auth-social-login-button",
245
- "version": "0.66.7"
245
+ "version": "0.66.9"
246
246
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-auth-social-login-button",
3
- "version": "0.66.7",
3
+ "version": "0.66.9",
4
4
  "contributors": [],
5
5
  "description": "Clickable OAuth provider tile (default SVGs for Google, GitHub, GitLab, Facebook, Authentik; overridable via slot). Builds the provider authorization URL from `provider` params or redirects to a prebuilt `url`, then on return parses the current page URL to exchange the code/token with `simple-serverless-auth-client` when `social_auth_server_url` and `auth_cookie_name` are set. Emits `oauthFlowInit`, `oauthFlowSuccess`, or `oauthFlowCustom` for custom providers without composed URLs.",
6
6
  "licenses": [