Skip to content

Commit ad03d43

Browse files
MajorTalclaude
andcommitted
feat(astro): default slot on SignIn/SignUp/UserButton/AccountSecurity (6.1/6.3)
Each form component now renders a default-empty <slot/> so consumers can append extras (OAuth buttons, magic-link/forgot links, extra fields, account panels) while the zero-config render (no slot content) preserves the prior DOM/classes/props. Additive/minor (6.3 - no-slot behavior unchanged). SignedIn/SignedOut were already slot-based. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 47330f9 commit ad03d43

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

astro/src/components/AccountSecurity.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ const show = (s: Section): boolean =>
160160
<a class="r402-as-link" href="/auth/sign-in/oauth/google/start?intent=link">Connect Google</a>
161161
</section>
162162
)}
163+
<!-- Consumer-supplied extra panels; empty by default (prior DOM
164+
preserved). §6.1/§6.3. -->
165+
<slot />
163166
</div>
164167
)}
165168

astro/src/components/SignIn.astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ const { returnTo = "/", class: className = "" } = Astro.props;
7070
</label>
7171

7272
<button type="submit" class="r402-submit">Sign in</button>
73+
<!-- Slot for consumer-supplied extras (OAuth buttons, a magic-link link,
74+
a "forgot password" link, extra fields). Empty by default, so the
75+
zero-config render preserves the prior DOM (§6.1/§6.3). -->
76+
<slot />
7377
</form>
7478

7579
<style>

astro/src/components/SignUp.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ const { returnTo = "/", class: className = "" } = Astro.props;
4949
</label>
5050

5151
<button type="submit" class="r402-submit">Create account</button>
52+
<!-- Consumer-supplied extras (terms checkbox, OAuth buttons, etc.); empty
53+
by default, so the zero-config render preserves the prior DOM (§6.1/§6.3). -->
54+
<slot />
5255
</form>
5356

5457
<style>

astro/src/components/UserButton.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ try {
7373
<input type="hidden" name="_csrf" value={csrfToken} />
7474
<span class="r402-user-label">{displayLabel}</span>
7575
<button type="submit" class="r402-sign-out">Sign out</button>
76+
<!-- Consumer extras (menu items, account links); empty by default so the
77+
zero-config render preserves the prior DOM (§6.1/§6.3). -->
78+
<slot />
7679
</form>
7780
)}
7881

0 commit comments

Comments
 (0)