Skip to content

Commit fe2d7cb

Browse files
committed
chore: v0.5.10
1 parent 66c7d9a commit fe2d7cb

File tree

5 files changed

+49
-38
lines changed

5 files changed

+49
-38
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 0.5.10 (April 4, 2025)
2+
- Fix an issue where other prefernences to skip onboarding affected every user.
3+
14
### 0.5.9 (April 3, 2025)
25
- Filter out empty users from the pre-auth keys page which could possibly cause a crash with unmigrated users.
36
- OIDC users cannot be renamed, so that functionality has been disabled in the menu options.

app/layouts/shell.tsx

+42-34
Original file line numberDiff line numberDiff line change
@@ -36,48 +36,56 @@ export async function loader({
3636
if (context.oidc && !request.url.endsWith('/onboarding')) {
3737
let onboarded = false;
3838

39-
try {
40-
const { users } = await context.client.get<{ users: User[] }>(
41-
'v1/user',
42-
session.get('api_key')!,
43-
);
39+
const sessionUser = session.get('user');
40+
if (sessionUser) {
41+
if (context.sessions.onboardForSubject(sessionUser.subject)) {
42+
// Assume onboarded
43+
onboarded = true;
44+
} else {
45+
try {
46+
const { users } = await context.client.get<{ users: User[] }>(
47+
'v1/user',
48+
session.get('api_key')!,
49+
);
4450

45-
if (users.length === 0) {
46-
onboarded = false;
47-
}
51+
if (users.length === 0) {
52+
onboarded = false;
53+
}
4854

49-
const user = users.find((u) => {
50-
if (u.provider !== 'oidc') {
51-
return false;
52-
}
55+
const user = users.find((u) => {
56+
if (u.provider !== 'oidc') {
57+
return false;
58+
}
5359

54-
// For some reason, headscale makes providerID a url where the
55-
// last component is the subject, so we need to strip that out
56-
const subject = u.providerId?.split('/').pop();
57-
if (!subject) {
58-
return false;
59-
}
60+
// For some reason, headscale makes providerID a url where the
61+
// last component is the subject, so we need to strip that out
62+
const subject = u.providerId?.split('/').pop();
63+
if (!subject) {
64+
return false;
65+
}
6066

61-
const sessionUser = session.get('user');
62-
if (!sessionUser) {
63-
return false;
64-
}
67+
const sessionUser = session.get('user');
68+
if (!sessionUser) {
69+
return false;
70+
}
6571

66-
if (context.sessions.onboardForSubject(sessionUser.subject)) {
67-
// Assume onboarded
68-
return true;
69-
}
72+
if (context.sessions.onboardForSubject(sessionUser.subject)) {
73+
// Assume onboarded
74+
return true;
75+
}
7076

71-
return subject === sessionUser.subject;
72-
});
77+
return subject === sessionUser.subject;
78+
});
7379

74-
if (user) {
75-
onboarded = true;
80+
if (user) {
81+
onboarded = true;
82+
}
83+
} catch (e) {
84+
// If we cannot lookup users, just assume our user is onboarded
85+
log.debug('api', 'Failed to lookup users %o', e);
86+
onboarded = true;
87+
}
7688
}
77-
} catch (e) {
78-
// If we cannot lookup users, just assume our user is onboarded
79-
log.debug('api', 'Failed to lookup users %o', e);
80-
onboarded = true;
8189
}
8290

8391
if (!onboarded) {

docs/Integrated-Mode.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Here is what a sample Docker Compose deployment would look like:
3434
services:
3535
headplane:
3636
# I recommend you pin the version to a specific release
37-
image: ghcr.io/tale/headplane:0.5.9
37+
image: ghcr.io/tale/headplane0.5.10:
3838
container_name: headplane
3939
restart: unless-stopped
4040
ports:
@@ -151,7 +151,7 @@ spec:
151151
serviceAccountName: default
152152
containers:
153153
- name: headplane
154-
image: ghcr.io/tale/headplane:0.5.9
154+
image: ghcr.io/tale/headplane0.5.10:
155155
env:
156156
# Set these if the pod name for Headscale is not static
157157
# We will use the downward API to get the pod name instead

docs/Simple-Mode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Here is what a sample Docker Compose deployment would look like:
1919
services:
2020
headplane:
2121
# I recommend you pin the version to a specific release
22-
image: ghcr.io/tale/headplane:0.5.9
22+
image: ghcr.io/tale/headplane0.5.10:
2323
container_name: headplane
2424
restart: unless-stopped
2525
ports:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "headplane",
33
"private": true,
44
"sideEffects": false,
5-
"version": "0.5.9",
5+
"version": "0.5.10",
66
"type": "module",
77
"scripts": {
88
"build": "react-router build",

0 commit comments

Comments
 (0)