Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ac010ee
Add user profile editing page for all authenticated users
sergeychernyshev Feb 16, 2026
24470f1
Use user name as a link to profile page
sergeychernyshev Feb 16, 2026
ba2d14a
Refresh power-strip after profile update
sergeychernyshev Feb 16, 2026
4f43290
Add credential management to profile page
sergeychernyshev Feb 16, 2026
5cad46e
Update architecture documentation and add data relationship diagram
sergeychernyshev Feb 16, 2026
c832252
Move credentials to SystemDO for centralized identity management
sergeychernyshev Feb 16, 2026
2779e85
Move credentials to provider-split CredentialDO
sergeychernyshev Feb 16, 2026
504ad64
Refactor credentials to be provider-partitioned and decentralized
sergeychernyshev Feb 16, 2026
f0b7394
Finalize decentralized provider-split identity architecture
sergeychernyshev Feb 16, 2026
22c7933
Decentralize credential management: CredentialDO by provider, UserDO …
sergeychernyshev Feb 16, 2026
9dfbc21
Final refactor: decentralize and partition credentials by provider
sergeychernyshev Feb 16, 2026
f75d18a
Refactor to use RPC for Durable Object communication and refine auth …
sergeychernyshev Feb 16, 2026
4981083
Added rule about RPC instead of fetch()
sergeychernyshev Feb 16, 2026
913727d
Updated tests to use RPC
sergeychernyshev Feb 16, 2026
056a6cc
Removed unused fetch handlers
sergeychernyshev Feb 16, 2026
fbe6d76
Moved credentials away from systemDO
sergeychernyshev Feb 17, 2026
a8d9a67
Fixed profile overriding on each login
sergeychernyshev Feb 17, 2026
26b7059
Show currently logged in scredential.
sergeychernyshev Feb 17, 2026
0ccd9c8
Allow changing avatar
sergeychernyshev Feb 17, 2026
0cd40ed
Updated admin ID for testing
sergeychernyshev Feb 17, 2026
14d63ac
Fixing admin tests
sergeychernyshev Feb 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ This application uses Cloudflare Developer Platform, including Workers and Durab

- Internal worker routes all start with `${usersPath}`, make sure to always prefix them
- Never override `.env` and `.dev.vars` files
- When calling DurableObjects from Workers or other DurableObjects, always use RPC instead of fetch()
- When generating DO stubs, always call stub variable to reflect which DO it refers to

## API

Expand Down
20 changes: 17 additions & 3 deletions public/users/power-strip.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ class PowerStrip extends HTMLElement {
this.addEventListeners();
}

async refresh() {
await this.fetchUser();
this.render();
this.addEventListeners();
}

async fetchUser() {
try {
const res = await fetch(`${this.basePath}/api/me`);
Expand All @@ -40,6 +46,7 @@ class PowerStrip extends HTMLElement {
if (data.valid) {
this.user = {
profile: data.profile,
credential: data.credential,
is_admin: data.is_admin,
is_impersonated: data.is_impersonated,
};
Expand Down Expand Up @@ -126,7 +133,7 @@ class PowerStrip extends HTMLElement {

if (providers.length > 0 && providers[0] !== '') {
if (this.user) {
const providerIcon = this.getProviderIcon(this.user.profile.provider);
const providerIcon = this.getProviderIcon(this.user.credential.provider);
const currentAccount = this.accounts.find((a) => a.is_current) || (this.accounts.length > 0 ? this.accounts[0] : null);
const accountName = currentAccount ? (currentAccount.personal ? this.user.profile.name : currentAccount.name) : 'No Account';

Expand Down Expand Up @@ -189,12 +196,12 @@ class PowerStrip extends HTMLElement {
${accountContainer}
<div class="avatar-container">
<img src="${this.user.profile.picture}" alt="${this.user.profile.name}" title="${this.user.profile.name}" class="avatar" width="16" height="16" />
<div class="provider-badge ${this.user.profile.provider}">
<div class="provider-badge ${this.user.credential.provider}">
${providerIcon}
</div>
</div>
<div class="user-info">
<span class="user-name">${this.user.profile.name}</span>
<a href="${this.basePath}/profile.html" class="user-name" title="Edit Profile">${this.user.profile.name}</a>
</div>
<a href="${logoutLink}" class="trigger logout-btn" title="Logout">Logout</a>
</div>
Expand Down Expand Up @@ -325,6 +332,13 @@ class PowerStrip extends HTMLElement {
overflow: hidden;
text-overflow: ellipsis;
font-weight: 600;
text-decoration: none;
display: block;
}

.user-name:hover {
text-decoration: underline;
color: #1a73e8;
}

.account-label {
Expand Down
Loading