File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,13 +143,10 @@ export default function RoomsPage() {
143143 } ) ;
144144
145145 if ( res . ok ) {
146- const newRoom = await res . json ( ) ;
147146 setRoomName ( "" ) ;
148147 toast . success ( "Room created" ) ;
149148
150149 mutate ( "/api/rooms" ) ;
151-
152- router . push ( `/room/${ newRoom . slug } ` ) ;
153150 } else {
154151 const error = await res . json ( ) ;
155152 toast . error ( error . error || "Failed to create room" ) ;
Original file line number Diff line number Diff line change @@ -84,8 +84,10 @@ export const authOptions: AuthOptions = {
8484 }
8585 return session ;
8686 } ,
87- async redirect ( ) {
88- return "/rooms" ;
87+ async redirect ( { url, baseUrl } ) {
88+ if ( url . startsWith ( "/" ) ) return `${ baseUrl } ${ url } ` ;
89+ if ( url . startsWith ( baseUrl ) ) return url ;
90+ return baseUrl ;
8991 } ,
9092 } ,
9193 debug : process . env . NODE_ENV === "development" ,
You can’t perform that action at this time.
0 commit comments