File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
infrastructure/eid-wallet/src/routes/(app)/scan-qr Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -111,15 +111,20 @@ onMount(async () => {
111
111
platform = params .get (" platform" );
112
112
session = params .get (" session" );
113
113
redirect = params .get (" redirect" );
114
- hostname = new URL (redirect as string ).hostname ;
115
114
if (! redirect || ! platform || ! session ) {
116
115
console .error (" Bad deeplink!" );
117
116
break ;
118
117
}
118
+ try {
119
+ hostname = new URL (redirect as string ).hostname ;
120
+ } catch (error ) {
121
+ console .error (" Invalid redirect URL:" , error );
122
+ break ;
123
+ }
119
124
// Validate platform name
120
125
if (! / ^ [a-zA-Z0-9 -_. ] + $ / .test (platform )) {
121
126
console .error (" Invalid platform name format" );
122
- return ;
127
+ break ;
123
128
}
124
129
125
130
// Validate session format (UUID)
@@ -129,7 +134,7 @@ onMount(async () => {
129
134
)
130
135
) {
131
136
console .error (" Invalid session format" );
132
- return ;
137
+ break ;
133
138
}
134
139
135
140
// Validate redirect URL domain
@@ -139,7 +144,7 @@ onMount(async () => {
139
144
)
140
145
) {
141
146
console .error (" Invalid redirect URL format." );
142
- return ;
147
+ break ;
143
148
}
144
149
codeScannedDrawerOpen = true ;
145
150
scanning = false ;
You can’t perform that action at this time.
0 commit comments