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: [
|
||||
// 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
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user