File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ function Header({
5656
5757export function Layout ( { children } : { children : React . ReactNode } ) {
5858 const user = requestInfo . ctx ?. user ;
59- const theme = requestInfo . ctx ?. theme || "system" ;
59+ const theme = requestInfo . ctx ?. theme ;
6060
6161 return (
6262 < div className = "min-h-screen bg-background" >
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ export async function finishPasskeyLogin(login: AuthenticationResponseJSON) {
163163 requireUserVerification : false ,
164164 credential : {
165165 id : credential . credentialId ,
166- publicKey : credential . publicKey ,
166+ publicKey : new Uint8Array ( credential . publicKey ) ,
167167 counter : credential . counter ,
168168 } ,
169169 } ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export type AppContext = {
2626 id : string ;
2727 email : string ;
2828 } | null ;
29- theme ? : "dark" | "light" | "system" ;
29+ theme : "dark" | "light" | "system" ;
3030} ;
3131
3232export const getUser = async ( session : Session | null ) => {
@@ -52,7 +52,13 @@ const app = defineApp([
5252 const themeMatch = cookieHeader ?. match (
5353 / (?: ^ | ; ) \s * t h e m e = ( d a r k | l i g h t | s y s t e m ) (?: ; | $ ) /
5454 ) ;
55- ctx . theme = ( themeMatch ?. [ 1 ] as "dark" | "light" | "system" ) || "system" ;
55+ ctx . theme = "system" ;
56+ if (
57+ themeMatch ?. [ 1 ] &&
58+ [ "dark" , "light" , "system" ] . includes ( themeMatch [ 1 ] )
59+ ) {
60+ ctx . theme = themeMatch [ 1 ] as "dark" | "light" | "system" ;
61+ }
5662
5763 try {
5864 ctx . session = await sessionStore . load ( request ) ;
You can’t perform that action at this time.
0 commit comments