@main12/auth-login 0.1.4 → 0.1.6

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 CHANGED
@@ -154,11 +154,11 @@ Use the plugin's hooks to build your own UI with any component library (HeroUI,
154
154
  | Hook | Returns | Key inputs |
155
155
  |------|---------|------------|
156
156
  | `useLoginFlow({ redirectTo, onPasswordLogin })` | `step, email, password, error, isLoading, handleEmailSubmit, handlePasswordSubmit, handleSendOtp, handleEditEmail` | `redirectTo: string`, `onPasswordLogin: (creds) => Promise<void>` |
157
- | `useSignupFlow()` | `name, email, error, isLoading, setName, setEmail, handleSubmit` | none — manages its own state |
158
157
  | `useForgotPasswordFlow()` | `email, error, isLoading, setEmail, handleSubmit` | none |
159
158
  | `useVerifyOtpFlow({ email, purpose, redirectTo })` | `otp, error, isLoading, isResending, resendCooldown, setOtp, handleSubmit, handleResendCode` | `email: string`, `purpose: 'login'\|'signup'\|'password-reset'` |
160
159
  | `useSetPasswordFlow({ redirectTo })` | `password, confirmPassword, error, isLoading, strength, setPassword, setConfirmPassword, handleSubmit` | `redirectTo: string` |
161
- | `useAuth()` (from Payload) | `user, login, logout, create` | (your existing Payload auth provider) |
160
+
161
+ > **Signup note:** No hook needed — call `signup(name, email)` from `@main12/auth-login/client`, then redirect to `/verify-otp?email=...&purpose=signup`.
162
162
 
163
163
  ### Full Example: Custom Login Page
164
164
 
@@ -0,0 +1,10 @@
1
+ import type { Endpoint } from 'payload';
2
+ /**
3
+ * GET /api/auth/oauth/google — start Google OAuth flow
4
+ */
5
+ export declare const googleOAuthStart: Endpoint;
6
+ /**
7
+ * GET /api/auth/oauth/google/callback — handle Google's redirect back
8
+ */
9
+ export declare const googleOAuthCallback: Endpoint;
10
+ export declare const googleOAuthEndpoints: Endpoint[];
package/dist/index.d.ts CHANGED
@@ -5,10 +5,10 @@ export interface AuthLoginPluginOptions {
5
5
  projectName?: string;
6
6
  contactEmail?: string;
7
7
  domain?: string;
8
- /** UI style for auth pages: 'tailwind' (default) or 'hero-ui' */
9
8
  style?: AuthStyle;
10
- /** Logo shown in all auth pages and email headers. Can be a URL string. */
11
9
  logo?: string;
10
+ /** Enable Google OAuth — reads GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET from env */
11
+ googleOAuth?: boolean;
12
12
  }
13
13
  export declare const authLoginPlugin: (options?: AuthLoginPluginOptions) => (config: Config) => Config;
14
14
  export { pluginConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@main12/auth-login",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Reusable Payload CMS auth plugin — login, signup, OTP, forgot password, branded emails, Powered by Main12",
5
5
  "license": "MIT",
6
6
  "type": "module",