File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
packages/start-plugin-core/tests/createMiddleware-start-compiler-plugin/snapshots Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1- import { createMiddleware } from " @tanstack/react-start" ;
2- import { getCookie } from " @tanstack/react-start/server" ;
1+ import { createMiddleware } from ' @tanstack/react-start' ;
2+ import { getCookie } from ' @tanstack/react-start/server' ;
33interface AuthMiddlewareOptions {
44 allowUnauthenticated ?: boolean ;
55}
@@ -11,5 +11,5 @@ interface AuthContext {
1111export const createAuthMiddleware = ( opts : AuthMiddlewareOptions = {
1212 allowUnauthenticated : false
1313} ) => createMiddleware ( {
14- type : " function"
14+ type : ' function'
1515} ) ;
Original file line number Diff line number Diff line change 1- import { createMiddleware } from " @tanstack/react-start" ;
2- import { getCookie } from " @tanstack/react-start/server" ;
1+ import { createMiddleware } from ' @tanstack/react-start' ;
2+ import { getCookie } from ' @tanstack/react-start/server' ;
33interface AuthMiddlewareOptions {
44 allowUnauthenticated ?: boolean ;
55}
@@ -11,14 +11,14 @@ interface AuthContext {
1111export const createAuthMiddleware = ( opts : AuthMiddlewareOptions = {
1212 allowUnauthenticated : false
1313} ) => createMiddleware ( {
14- type : " function"
14+ type : ' function'
1515} ) . server < AuthContext > ( ( {
1616 next
1717} ) => {
18- const token = getCookie ( " session" ) ;
18+ const token = getCookie ( ' session' ) ;
1919 if ( ! token ) {
2020 if ( ! opts . allowUnauthenticated ) {
21- throw new Error ( " Unauthorized" ) ;
21+ throw new Error ( ' Unauthorized' ) ;
2222 }
2323 return next ( {
2424 context : {
You can’t perform that action at this time.
0 commit comments