mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
[PS-617] Fix null value detection on ssoToken parameter (#2085)
* Fix null value detection on ssoToken parameter * Use TryGet * Format Co-authored-by: Justin Baur <admin@justinbaur.com>
This commit is contained in:
parent
2979fde0f7
commit
c0f2255569
@ -116,9 +116,10 @@ namespace Bit.Identity
|
||||
context.ProtocolMessage.SessionState = context.Properties.Items["user_identifier"];
|
||||
}
|
||||
|
||||
if (context.Properties.Parameters.Count > 0 && context.Properties.Parameters.ContainsKey(SsoTokenable.TokenIdentifier))
|
||||
if (context.Properties.Parameters.Count > 0 &&
|
||||
context.Properties.Parameters.TryGetValue(SsoTokenable.TokenIdentifier, out var tokenValue))
|
||||
{
|
||||
var token = context.Properties.Parameters[SsoTokenable.TokenIdentifier].ToString();
|
||||
var token = tokenValue?.ToString() ?? "";
|
||||
context.ProtocolMessage.Parameters.Add(SsoTokenable.TokenIdentifier, token);
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user