File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -389,18 +389,18 @@ public RootCommand GetRootCommand(ILogger logger)
389
389
var claims = new Dictionary < string , string > ( ) ;
390
390
foreach ( var token in result . Tokens )
391
391
{
392
- var claim = token . Value ;
393
- var parts = claim . Split ( ':' ) ;
394
- var isValidClaim = parts . Length == 2 && ! string . IsNullOrWhiteSpace ( parts [ 0 ] ) && ! string . IsNullOrWhiteSpace ( parts [ 1 ] ) ;
395
- if ( ! isValidClaim )
392
+ var claim = token . Value . Split ( ":" ) ;
393
+ var ( key , value ) = ( claim [ 0 ] , claim [ 1 ] ) ;
394
+
395
+ if ( ! string . IsNullOrEmpty ( key ) && ! string . IsNullOrEmpty ( value ) )
396
396
{
397
397
result . ErrorMessage = $ "Invalid claim format: '{ claim } '. Expected format is name:value.";
398
398
return claims ?? [ ] ;
399
399
}
400
400
401
401
try
402
402
{
403
- claims . Add ( parts [ 0 ] , parts [ 1 ] ) ;
403
+ claims . Add ( key , value ) ;
404
404
}
405
405
catch ( Exception ex )
406
406
{
You can’t perform that action at this time.
0 commit comments