my own indieAuth provider! indiko.dunkirk.sh/docs
indieauth oauth2-server
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: update links

+19 -6
+1 -1
src/index.ts
··· 230 230 "/auth/login/options": loginOptions, 231 231 "/auth/login/verify": loginVerify, 232 232 // Dynamic routes with Bun's :param syntax 233 - "/u/:username": (req) => userProfile(req, req.params.username), 233 + "/u/:username": userProfile, 234 234 "/api/apps/:clientId": (req) => { 235 235 if (req.method === "DELETE") return revokeApp(req, req.params.clientId); 236 236 return new Response("Method not allowed", { status: 405 });
+18 -5
src/routes/indieauth.ts
··· 1123 1123 } 1124 1124 1125 1125 // GET /u/:username - Public user profile (h-card) 1126 - export function userProfile(req: Request, username: string): Response { 1126 + export function userProfile(req: Request): Response { 1127 + const username = (req as any).params?.username; 1128 + if (!username) { 1129 + return new Response("Username required", { status: 400 }); 1130 + } 1131 + 1127 1132 const user = db 1128 1133 .query("SELECT username, name, email, photo, url FROM users WHERE username = ?") 1129 1134 .get(username) as ··· 1221 1226 .p-name:hover { 1222 1227 color: var(--berry-crush); 1223 1228 } 1224 - .u-email { 1229 + .u-email, .u-url-link { 1225 1230 color: var(--old-rose); 1226 1231 text-decoration: none; 1227 1232 margin-top: 0.5rem; 1228 1233 font-size: 0.875rem; 1229 1234 } 1230 - .u-email:hover { 1235 + .u-email:hover, .u-url-link:hover { 1231 1236 color: var(--berry-crush); 1237 + } 1238 + .links { 1239 + display: flex; 1240 + gap: 1rem; 1241 + margin-top: 0.5rem; 1232 1242 } 1233 1243 .identity-info { 1234 1244 margin-top: 1rem; ··· 1300 1310 <div class="container"> 1301 1311 <div class="h-card"> 1302 1312 ${user.photo ? `<img class="u-photo" src="${user.photo}" alt="${user.name}" />` : ""} 1303 - <a class="p-name u-url" href="${user.url || `${process.env.ORIGIN}/u/${user.username}`}">${user.name}</a> 1304 - ${user.email ? `<a class="u-email" href="mailto:${user.email}">email</a>` : ""} 1313 + <h1 class="p-name">${user.name}</h1> 1314 + <div class="links"> 1315 + ${user.url ? `<a class="u-url u-url-link" rel="me" href="${user.url}">website</a>` : ""} 1316 + ${user.email ? `<a class="u-email" rel="me" href="mailto:${user.email}">email</a>` : ""} 1317 + </div> 1305 1318 <div class="identity-info"> 1306 1319 IndieAuth identity: <code>${process.env.ORIGIN}/u/${user.username}</code> 1307 1320 </div>