File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,10 @@ export function stringifyPath(path: Path<SegmentType>): string {
239239 let urlPath = "" ;
240240 let prevSegment : Segment < SegmentType > | undefined ;
241241 for ( const segment of path . segments ) {
242+ if ( segment . type === "oidc-callback" || segment . type === "oidc-error" ) {
243+ // Do not put these segments in URL
244+ continue ;
245+ }
242246 const encodedSegmentValue = encodeSegmentValue ( segment . value ) ;
243247 switch ( segment . type ) {
244248 case "rooms" :
@@ -257,10 +261,6 @@ export function stringifyPath(path: Path<SegmentType>): string {
257261 break ;
258262 case "right-panel" :
259263 case "sso" :
260- case "oidc-callback" :
261- case "oidc-error" :
262- // Do not put these segments in URL
263- continue ;
264264 default :
265265 urlPath += `/${ segment . type } ` ;
266266 if ( encodedSegmentValue ) {
@@ -272,7 +272,8 @@ export function stringifyPath(path: Path<SegmentType>): string {
272272 return urlPath ;
273273}
274274
275- function encodeSegmentValue ( value : SegmentType [ keyof SegmentType ] ) : string {
275+ // We exclude the OIDC segment types as they are never encoded
276+ function encodeSegmentValue ( value : Exclude < SegmentType [ keyof SegmentType ] , { state : string } > ) : string {
276277 if ( value === true ) {
277278 // Nothing to encode for boolean
278279 return "" ;
You can’t perform that action at this time.
0 commit comments