Questions tagged [middleware]
Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue".
4,362
questions
0
votes
0
answers
9
views
User Authentication Issue in Next.js: Protected Routes Accessible After Logout Until Page Refresh
I am currently working on a Next.js application where I have implemented user authentication using cookies and Redux. I've encountered an issue where protected routes remain accessible immediately ...
-3
votes
0
answers
14
views
NextJS can´t building [closed]
I got the following error when I want to build my NextJS program.
Error
Please help me I can not get any further
1
vote
0
answers
52
views
How to secure specific pages using NextAuth and Middleware after authentication
I am having trouble securing specific pages in my Next.js application after authentication using Middleware and NextAuth.
Pages are protected until a user logs in, at which point they become visible. ...
-1
votes
0
answers
6
views
Override behaviour of Terminate instance in Ec2
I want to add a code check during Terminating an Instance to find if the instance is suitable for termination.
So basically during termination by api or via console, I want the check to run as a ...
0
votes
0
answers
37
views
Blazor WASM- Client breakpoints not working when using Middleware on Server
In Visual Studio Community 2022 Version 17.7.4, with both projects targeting .NET 7.0:
In my Blazor WASM project, I need to implement API key authentication on my API (Server side). I have attempted a ...
0
votes
1
answer
24
views
Seeking Guidance on Error Handling and Routing
I would like to request a review of my app.js file (Clone Project Bootcamp) to ensure that I have implemented error handling correctly. Below is the relevant portion of my app.js code:
const express = ...
0
votes
0
answers
6
views
Cannot use 'in' operator to search for 'stack' in 401 error when awaiting getUser() in nuxt middleware
I have a nuxtjs frontend with an express backend and i want to use a middleware to determent if the user should be able to navigate to a certain page. Even though it works with onMounted and such the ...
0
votes
0
answers
12
views
Can i make requests using a cookie in a nuxtjs middleware
I am using the fetch api to request the current users identity from my express backend in my pinia store. However the cookie is not sent to the backend even though it has credentials: 'include' and ...
0
votes
0
answers
12
views
How to match a hidden folder in next 13 middleware matcher
I have this segment path: "/(protected)/" in my next13 app where I want to place all my protected pages.
To achieve that, I need a way to match that path segment in the middleware matcher as ...
0
votes
0
answers
17
views
Laravel Passport with custom guard is not working
I want to implement multi-type user authentication with Laravel and Passport. There are users and admins with different tables and different models.
In the auth.php config, I've added the guards and ...
0
votes
0
answers
12
views
How to use DetectOverflow or Custom Middleware from Floating UI JS with Serverless Vanilla JS?
I am dealing with an overflow problem on my div when dragging my Floating UI tooltips. Floating UI has a solution for this natively called detectOverflow, but I've had issues trying to prevent it from ...
0
votes
0
answers
4
views
Requests from nuxtjs auth middleware to backend don't go trough?
I know that he title of this question is not very good however there is nothing descriptive of what i am facing, so i have a frontend on nuxtjs and a backend on expressjs i can login and everything i ...
0
votes
1
answer
24
views
Migrating an application with subdomains to a single URL
I currently have an application that uses django-tenants with subdomains for each tenant (tenant1.domain.com, tenant2.domain.com...)
It uses individual authentication, the auth models are in the ...
1
vote
0
answers
54
views
Blazor, in middleware check if the request path is going to produce a page
I'm writing a middleware in a Blazor application that basically checks if the system is sleeping and, if it is, presents a static HTML file.
public class PowerMiddleWare
{
private readonly ...
-1
votes
0
answers
19
views
How do i use server-only functions in Next.js middleware?
I am using Next.js 13 with the App Router.
When trying to import a server-only fetch function into middleware.js, I get the following error message:
Error: This module cannot be imported from a ...
0
votes
1
answer
25
views
Why my middleware doesn't protect routes?
I am using next.js and trying to use middleware. If cookies has not token, it means there is no user, so no one should access specific page as profile. But in my case, when I dont have token and write ...
0
votes
1
answer
31
views
Next.js 13 (App Router) and Auth0 best practices
From my understanding, the stable version of Auth0 for Nextjs 13 was released this past August. Maybe that's why there aren't that many example out there, but my question is what the best practices ...
0
votes
0
answers
19
views
use middleware in nextjs to check user is authenticated or not using firebase-auth
I am planning to use nextjs 13 in my project with firebase for authentication and database.
My question is how can I use nextjs 13 middleware to check if user is authenticated or not, can i do that, ...
0
votes
1
answer
20
views
Troubleshooting Backend Unresponsiveness and 500 Error on Web Host in ASP.NET Core Application
I'm currently facing a perplexing issue with my ASP.NET Core 6 web application when hosted on a web server. Everything functions flawlessly on my local development server, but once the application is ...
0
votes
0
answers
22
views
Why is there no Jwt cookie authentication method for IServiceCollection?
Jwt.io states that tokens are usually passed through the Authorization Header in a HTTP request. My research shows me that storing a JWT in a HTTPOnly cookie is more secure than storing your token in ...
0
votes
0
answers
21
views
Validation a request as function without middleware
is there a use of express-validator as non-middleware, just a function to send request json and take errors as a return.
import express from 'express';
import { body, validationResult } from 'express-...
0
votes
1
answer
17
views
How to save data in Node JS for a time of request processing?
I want to get the user ID by the passed session ID / auth token in my auth middleware, and then have it available elsewhere after that. How can I do it right, use a global var? Maybe there are better ...
0
votes
0
answers
29
views
Next Auth middleware export { default } from "next-auth/middleware"; not working
I'm currently working on a project using Next.js 13 (version 13.4.19) and I've integrated NextAuth.js (version ^4.23.1) for authentication. I'm trying to use the next-auth/middleware module to secure ...
0
votes
0
answers
25
views
Infinite Middleware Calls when Using not-found.tsx in Next.js 13
I'm experiencing a strange issue with my Next.js project, which is running on version ^13.4.19. I've implemented the "not-found.tsx" page in my "/app" folder, but I'm encountering ...
1
vote
1
answer
23
views
Only apply https redirection middleware based on a scoped service
I have a web application that runs multiple websites. Based on a configuration loaded from the database, some sites must be redirected to HTTPS and some not. I would like to make use of the default ...
0
votes
0
answers
17
views
OBIEE 12 c RCU installation stuck on DB connection
I am trying to install OBIEE 12c on DB 12c using a VM box.
I have finished all perquisites steps and stuck on RCU step when entering connection parameters.
Here is the error message:
Here's my ...
3
votes
1
answer
322
views
how to make middleware on spesific routes in ElysiaJS?
I attempted to use ElysiaJS for creating a backend server and encountered an issue while attempting to implement middleware functionality that similar to Express. I try to set the middleware on a ...
0
votes
0
answers
51
views
Laravel 10 - Submit Form after Login trough Auth Middleware
I want to submit a form in Laravel, the controller and route are secured with Auth Middleware. Now the user is redirected to the login and then back to the form, but without the old values. Is it ...
0
votes
0
answers
26
views
How to dynamically set or execute middlewares for a page the right way in Nuxt 3?
This is probably the wrong way, but it explains the idea:
// middleware/some-middleware.ts
import otherMiddleware from "@/middleware/other-middleware"
import other2Middleware from "@/...
2
votes
1
answer
42
views
How to log query execution time in Doctrine 3 using middlewares, now that "setSQLLogger()" is deprecated?
Doctrine has deprecated its ->setSQLLogger() in favour of Middleware.
I can't find any way to log start and end of query to get execution time.
Previously it could be done like in this question ...
0
votes
1
answer
24
views
Nuxt3 Middleware - Access VueX stores
I'm migrating a Nuxt2 app to Nuxt3. In a middleware i access a store state using 'context' like:
export default function (context) {
const userName = context.store.state.common.auth.user
}
In ...
0
votes
0
answers
13
views
How to Access TurnState Data Added by Middleware in Bot Framework Composer?
I am working with the Bot Framework and Composer. I've written some middleware to log the conversation and I need to pass this history back so that it's accessible in Composer.
I have successfully ...
0
votes
0
answers
65
views
TypeError: Cannot read properties of undefined (reading 'status')
i am facing this problem on my JavaScript (node.js) web-app. I am trying to create a middleware to authenticate and register a user as an admin. The code doesn't return an error until i test it on ...
0
votes
0
answers
25
views
protecting routes in next js with middleware + next-auth
please I am trying to protect some routes with the NextJS middleware if I am not authenticated, I am using next-auth for authentication and from the documentation this is what it says the middleware....
0
votes
0
answers
24
views
authentication using middleware.ts in NEXT.js 13
I am currently coding an authentication system for my next.js app. My app has a login and user dashboard route. I have used post request method using Async and await to call API and store the JWT ...
0
votes
1
answer
30
views
Middleware not executing on Nextjs 13.4 app routing
I have a problem.
My middleware doesn't get executed...
This is my code:
export const config = {
matcher: '/api/:function*',
};
This is the config I gave, it should only execute when the API gets a ...
0
votes
0
answers
26
views
Need a Detail Info About (Next) in Middleware
How does Next work in Middleware how does it know whether to allow a request through one pipeline to another? and how does it block when it feels the request is not proper or missing? how can I know ...
0
votes
1
answer
74
views
I can't see the mistake im doing in laravel php Routes for api
Im having problem with correct setting of api.php in Laravel, I can't seem to get the Routes with prefixes right. Here is the code for my routes, the problem is that I want to use middleware on first ...
1
vote
1
answer
38
views
Passing request parameter into middleware which uses 'createHandler' function of 'graphql-http'
I have created an express server which uses GraphQL for handling requests over HTTP. Among others, the express server has the two middlewares below.
app.use(authenticate);
app.use('/graphql', ...
0
votes
0
answers
23
views
How to get dynamic path from Next.js 13 Middleware?
I am currently trying to retrieve this slug value when the /@slug path is in the middleware.
That slug value could be @dfdnsjvnds
@abcscs That might be it.
How should path pattern matching be done in ...
2
votes
0
answers
30
views
Nuxt Middleware | httpOnly Cookie after page reload gone
Hello i want to save a JWT token in an HttpOnly cookie. The token is received from a django backend after successful login.
Everything works fine until i add the HttpOnly flag in the pinia store.
How ...
0
votes
0
answers
15
views
Django Middleware check if page contents was cached
I have a middleware that manages and denies access based on trial info stored in the user model. One aspect of it is that it increments the request count by 1 each time.
But also on a lot of ...
0
votes
0
answers
32
views
NextJs Middleware not reading cookie until page refresh?
I have a NextJs site where I use middleware to ensure a user "has" a session cookie to allow them into certain pages. It works fine in localhost, but when I upload it to Vercel I cannot ...
0
votes
0
answers
75
views
Chain Multiple Middleware Functions in NextJs 13 for authentication and internationalization
Disclaimer
If you want to have a deeper look into my code this is the repo. Navigate to apps/ott-platform. You have to create an account on Clerk and type in your Clerk key in .env.
Problem
I have a ...
1
vote
1
answer
54
views
How can I prepopulate certain properties in a model before a method is executed within a Controller
I have multiple input models, and the majority of them include 'OwnerId' and 'CreatedBy' properties. I am seeking a mechanism to automatically populate these properties with default values. I ...
1
vote
2
answers
92
views
How can I rewrite query string in ASP.NET Core middleware?
This is the URL that comes to my server:
https://example.com/path?key-one=value&key-two=value2
And I want to convert it to this URL, but I don't want to redirect the user. So I need to rewrite:
...
0
votes
0
answers
24
views
import model in next js 13 middleware
I'm using Next.js 13 and I have a User model in my application.
for user authentication, I should import my User model in middleware.js file.
when I import a model in middleware, this error happen.
...
0
votes
0
answers
19
views
how i can update next middleware, so when user is logged in and try to visit loginPages (ie, login, register) they will redirect to dashboard
import {withAuth} from 'next-auth/middleware';
import createIntlMiddleware from 'next-intl/middleware';
import { NextResponse } from 'next/server';
const locales = ['en'];
const protectedPages = ['/...
0
votes
0
answers
17
views
What's the difference between passing express middlewares individually and as an array?
I ran into an interesting problem when trying to validate request params with zod-express-middleware. The problem can be recreated with these two simple files:
middleware.ts
import express from '...
0
votes
0
answers
47
views
Middleware functionality in Next.js 13.4
I really struggled the whole day, at last, I came to an end to share my problem with you so you as a professional developer, resolve my problem. so, I'm having a problem getting Next Auth token that ...