Refactor context value assignment in Auth middleware for improved readability

This commit is contained in:
Leon Bösche
2026-01-11 04:02:04 +01:00
parent bd6dd68f0b
commit 615c92dc5f
2 changed files with 4 additions and 6 deletions

View File

@@ -193,9 +193,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
children: [
// Personal workspace button (always show when logged in)
_buildPersonalButton(selectedOrg == null, () {
context.read<OrganizationBloc>().add(
SelectOrganization(''),
);
context.read<OrganizationBloc>().add(SelectOrganization(''));
}),
const SizedBox(width: 16),
// Organization tabs

View File

@@ -108,9 +108,9 @@ func Auth(jwtManager *jwt.Manager, db *database.DB) func(http.Handler) http.Hand
return
}
ctx := context.WithValue(r.Context(), UserKey, claims.UserID)
ctx = context.WithValue(ctx, SessionKey, session)
ctx = context.WithValue(ctx, TokenKey, tokenString)
ctx := context.WithValue(r.Context(), UserKey, claims.UserID)
ctx = context.WithValue(ctx, SessionKey, session)
ctx = context.WithValue(ctx, TokenKey, tokenString)
next.ServeHTTP(w, r.WithContext(ctx))
})
}