Refactor context value assignment in Auth middleware for improved readability
This commit is contained in:
@@ -193,9 +193,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
children: [
|
children: [
|
||||||
// Personal workspace button (always show when logged in)
|
// Personal workspace button (always show when logged in)
|
||||||
_buildPersonalButton(selectedOrg == null, () {
|
_buildPersonalButton(selectedOrg == null, () {
|
||||||
context.read<OrganizationBloc>().add(
|
context.read<OrganizationBloc>().add(SelectOrganization(''));
|
||||||
SelectOrganization(''),
|
|
||||||
);
|
|
||||||
}),
|
}),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
// Organization tabs
|
// Organization tabs
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ func Auth(jwtManager *jwt.Manager, db *database.DB) func(http.Handler) http.Hand
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := context.WithValue(r.Context(), UserKey, claims.UserID)
|
ctx := context.WithValue(r.Context(), UserKey, claims.UserID)
|
||||||
ctx = context.WithValue(ctx, SessionKey, session)
|
ctx = context.WithValue(ctx, SessionKey, session)
|
||||||
ctx = context.WithValue(ctx, TokenKey, tokenString)
|
ctx = context.WithValue(ctx, TokenKey, tokenString)
|
||||||
next.ServeHTTP(w, r.WithContext(ctx))
|
next.ServeHTTP(w, r.WithContext(ctx))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user