@haloduck/ui 2.1.0 → 2.1.1

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.
@@ -1,131 +0,0 @@
1
- # Social Login Configuration Guide
2
-
3
- ## Overview
4
-
5
- AuthenticateComponent can be configured with social login providers through Angular's dependency
6
- injection system using ApplicationConfig providers.
7
-
8
- ## Configuration
9
-
10
- ### 1. Import Required Types and Functions
11
-
12
- ```typescript
13
- import { SocialLoginProvider, provideSocialLoginProviders } from '@haloduck/ui';
14
- ```
15
-
16
- ### 2. Configure in ApplicationConfig
17
-
18
- ```typescript
19
- import { ApplicationConfig } from '@angular/core';
20
- import { SocialLoginProvider, provideSocialLoginProviders } from '@haloduck/ui';
21
-
22
- const socialProviders: SocialLoginProvider[] = [
23
- {
24
- name: 'google',
25
- enabled: true,
26
- clientId: 'your-google-client-id',
27
- redirectUrl: 'https://yourdomain.com/auth/callback',
28
- },
29
- {
30
- name: 'apple',
31
- enabled: true,
32
- clientId: 'your-apple-client-id',
33
- redirectUrl: 'https://yourdomain.com/auth/callback',
34
- },
35
- {
36
- name: 'kakao',
37
- enabled: true,
38
- clientId: 'your-kakao-client-id',
39
- redirectUrl: 'https://yourdomain.com/auth/callback',
40
- state: { customParam: 'value' },
41
- },
42
- ];
43
-
44
- export const appConfig: ApplicationConfig = {
45
- providers: [
46
- // ... other providers
47
- provideSocialLoginProviders(socialProviders),
48
- // ... other providers
49
- ],
50
- };
51
- ```
52
-
53
- ### 3. Use in Routes
54
-
55
- ```typescript
56
- import { Routes } from '@angular/router';
57
- import { AuthenticateComponent } from '@haloduck/ui';
58
-
59
- export const routes: Routes = [
60
- {
61
- path: 'auth',
62
- component: AuthenticateComponent,
63
- },
64
- // ... other routes
65
- ];
66
- ```
67
-
68
- ## SocialLoginProvider Interface
69
-
70
- ```typescript
71
- interface SocialLoginProvider {
72
- name: 'google' | 'apple' | 'kakao';
73
- enabled: boolean;
74
- clientId?: string;
75
- redirectUrl?: string;
76
- state?: { [key: string]: string };
77
- }
78
- ```
79
-
80
- ### Properties
81
-
82
- - **name**: The social provider type ('google' | 'apple' | 'kakao')
83
- - **enabled**: Whether this provider should be available in the UI
84
- - **clientId**: OAuth client ID for the provider (optional)
85
- - **redirectUrl**: Callback URL after authentication (optional, defaults to current origin)
86
- - **state**: Additional state parameters for OAuth flow (optional, Kakao only)
87
-
88
- ## Environment-Specific Configuration
89
-
90
- ### Development
91
-
92
- ```typescript
93
- const socialProviders: SocialLoginProvider[] = [
94
- {
95
- name: 'google',
96
- enabled: true,
97
- clientId: 'dev-google-client-id',
98
- redirectUrl: 'http://localhost:4200/auth/callback',
99
- },
100
- // ... other providers
101
- ];
102
- ```
103
-
104
- ### Production
105
-
106
- ```typescript
107
- const socialProviders: SocialLoginProvider[] = [
108
- {
109
- name: 'google',
110
- enabled: true,
111
- clientId: 'prod-google-client-id',
112
- redirectUrl: 'https://yourproductionsite.com/auth/callback',
113
- },
114
- // ... other providers
115
- ];
116
- ```
117
-
118
- ## Fallback Configuration
119
-
120
- If no providers are configured via DI, AuthenticateComponent will use the default configuration with
121
- all providers enabled but without clientId values.
122
-
123
- ## Input Override
124
-
125
- You can still override the providers configuration by passing it as an Input property:
126
-
127
- ```html
128
- <haloduck-authenticate [socialLoginProviders]="customProviders"></haloduck-authenticate>
129
- ```
130
-
131
- This will override the DI configuration for that specific component instance.