File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/rules-unit-testing/src/api Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,10 @@ export type FirebaseEmulatorOptions = {
158
158
} ;
159
159
} ;
160
160
161
+ function trimmedBase64Encode ( val : string ) : string {
162
+ return base64Encode ( val ) . split ( "=" ) [ 0 ] ;
163
+ }
164
+
161
165
function createUnsecuredJwt ( token : TokenOptions , projectId ?: string ) : string {
162
166
// Unsecured JWTs use "none" as the algorithm.
163
167
const header = {
@@ -199,8 +203,8 @@ function createUnsecuredJwt(token: TokenOptions, projectId?: string): string {
199
203
// Unsecured JWTs use the empty string as a signature.
200
204
const signature = '' ;
201
205
return [
202
- base64Encode ( JSON . stringify ( header ) ) ,
203
- base64Encode ( JSON . stringify ( payload ) ) ,
206
+ trimmedBase64Encode ( JSON . stringify ( header ) ) ,
207
+ trimmedBase64Encode ( JSON . stringify ( payload ) ) ,
204
208
signature
205
209
] . join ( '.' ) ;
206
210
}
You can’t perform that action at this time.
0 commit comments