Skip to content

feat: account 0.1 - #67

Merged
pierosavi merged 18 commits into
mainfrom
feat/account-0.1
Nov 2, 2026
Merged

pierosavi merged 18 commits into
mainfrom
feat/account-0.1

Conversation

@PhilipTrauner

Copy link
Copy Markdown
Collaborator

85ac5fe contains the server-side bits of account 0.1

should be rebased on top of #66 so it can be feature-gated, as we don't yet have the required legal copy in place

@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for device-database-preview ready!

Name Link
🔨 Latest commit 18b64df
🔍 Latest deploy log https://app.netlify.com/projects/device-database-preview/deploys/6ae897706fe2580e0a617892
😎 Deploy Preview https://deploy-preview-67--device-database-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pierosavi
pierosavi marked this pull request as ready for review October 26, 2026 18:50
@pierosavi

pierosavi commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Added UI, hidden behind account feature flag https://deploy-preview-67--device-database-preview.netlify.app/?feature=account
Added account page with Sign Out (this browser only) and Disconnect GitHub (revokes the app's access everywhere, after confirmation)
Covered some edge cases on auth change, added some tests

Solved dynamic content in prerendered pages by attaching data-github-session to html when github-user cookie is present, then CSS switches between Sign In and the avatar, and between the signed-in and signed-out account page. The avatar src is filled in on the client from the cookie.

{/* Before first paint, so signed-in visitors don't see "Sign In" flash */}
<script is:inline>
(function () {
function apply() {
document.documentElement.toggleAttribute(
"data-github-session",
/(?:^|;\s*)github-user=/.test(document.cookie),
);
}
apply();
document.addEventListener("astro:after-swap", apply);
})();
</script>

@pierosavi
pierosavi requested a balanced review from Copilot and removed request for Copilot October 26, 2026 19:56
@pierosavi
pierosavi requested a review from stvncode October 27, 2026 09:04

@PhilipTrauner PhilipTrauner left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor nits, but overall this is great 🙌
thanks especially for wrapping your head around the necessary caching invariants for this

Comment on lines +49 to +57
<a
class="account-provider"
href={signInHref}
data-astro-reload
data-astro-prefetch="false"
>
<GitHubMark width="18" height="18" class="icon" aria-hidden="true" />
GitHub
</a>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image Image

text is currently not visible until hovering 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how I missed this! Fixed

Comment thread src/pages/vendor/github/callback.ts Resolved
Comment thread src/styles/account.css Resolved
Comment on lines +34 to +40
// account name missing, re-authentication required
// checked before refreshing, which would use up the refresh token
const login = cookies.get(GITHUB_COOKIE_USER)?.value;
if (typeof login === "undefined") {
GitHubOAuth.session.clear(cookies);
return status(401, SESSION_CHANGE_HEADERS);
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense to move this here instead 👌

pierosavi and others added 3 commits November 2, 2026 13:23
Co-authored-by: philip trauner <philip.trauner@arztpraxis.io>
Co-authored-by: philip trauner <philip.trauner@arztpraxis.io>
@pierosavi
pierosavi merged commit f3b396b into main Nov 2, 2026
7 checks passed
@pierosavi
pierosavi deleted the feat/account-0.1 branch November 2, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants