File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,35 @@ export const parseSearchParamsToObject = (search: string) => {
42
42
"state" ,
43
43
"post_login_redirect_url" ,
44
44
"authUrlParams" ,
45
+ "redirect_url"
45
46
] . includes ( key )
46
47
) {
47
48
delete paramsObject [ key ] ;
48
49
}
49
50
} ) ;
50
51
52
+
53
+ Object . keys ( paramsObject . authUrlParams ) . forEach ( ( key ) => {
54
+ if (
55
+ [
56
+ "start_page" ,
57
+ "is_create_org" ,
58
+ "response_type" ,
59
+ "org_name" ,
60
+ "org_code" ,
61
+ "state" ,
62
+ "post_login_redirect_url" ,
63
+ "authUrlParams" ,
64
+ "redirect_url"
65
+ ] . includes ( key )
66
+ ) {
67
+ delete paramsObject . authUrlParams [ key ] ;
68
+ }
69
+ } ) ;
70
+
71
+ if ( Object . keys ( paramsObject . authUrlParams ) . length === 0 ) {
72
+ delete paramsObject . authUrlParams ;
73
+ }
74
+
51
75
return paramsObject ;
52
76
} ;
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ describe("Utils", () => {
6
6
it ( "should parse search parameters to an object" , ( ) => {
7
7
const searchParams = "?param1=value1¶m2=value2" ;
8
8
const expectedOutput = {
9
- param1 : "value1" ,
10
- param2 : "value2" ,
9
+ authUrlParams : {
10
+ param1 : "value1" ,
11
+ param2 : "value2" ,
12
+ }
11
13
} ;
12
14
13
15
const output = parseSearchParamsToObject ( searchParams ) ;
You can’t perform that action at this time.
0 commit comments