Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ async function _DEMO_logIn() {
return await _DEMO_logIn();

// In production, you will need to redirect unauthorized users
// return NextResponse.redirect(new URL('/login', req.nextUrl))
// return NextResponse.redirect(new URL('/auth/login', req.nextUrl))
}

export default async function middleware(req<%=#isTypeScript%>: NextRequest<%=/isTypeScript%>) {
const path = req.nextUrl.pathname;


if (!isProtectedRoute(path)) {
return NextResponse.next();
}

const cookie = (await cookies()).get('session')?.value;

if (!cookie) {
return await redirectUnauthorized(req);
}

const session = await decrypt(cookie);
if (isProtectedRoute(path) && !session?.userId) {

if (!session?.userId) {
return await redirectUnauthorized(req);
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 1 addition & 8 deletions packages/devextreme-cli/testing/app-template.test.shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,7 @@ module.exports = (env, { port = 8080, urls = {} } = {}) => {
await page.waitForTimeout(3000);
const image = await takeScreenshot();

const isProblemTest = env.engine.startsWith('nextjs')
&& theme === 'material'
&& viewportName === 'large'
&& layout === 'side-nav-outer-toolbar';

compareSnapshot(image, 'create-account', {
threshold: isProblemTest ? 0.025 : customConfig.threshold
});
compareSnapshot(image, 'create-account');
});

it('Reset password page', async() => {
Expand Down
Loading