File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -145,9 +145,13 @@ const redirectToPostLoginUrl = async () => {
145
145
const post_login_redirect_url = value as string ;
146
146
sessionStorage . removeSessionItem ( KEY_POST_LOGIN_REDIRECT_URL ) ;
147
147
148
+ const appBaseUrl = new URL ( kindeConfiguration . appBase ) ;
148
149
if ( isAbsoluteUrl ( post_login_redirect_url ) ) {
149
- redirect ( 302 , new URL ( post_login_redirect_url ) ) ;
150
- } else {
151
- redirect ( 302 , new URL ( post_login_redirect_url , kindeConfiguration . appBase ) ) ;
150
+ const target = new URL ( post_login_redirect_url ) ;
151
+ if ( target . origin !== appBaseUrl . origin ) {
152
+ return ;
153
+ }
154
+ throw redirect ( 302 , target . toString ( ) ) ;
152
155
}
156
+ throw redirect ( 302 , new URL ( post_login_redirect_url , appBaseUrl ) . toString ( ) ) ;
153
157
} ;
You can’t perform that action at this time.
0 commit comments