This happens when I log in to Facebook and then log in again. It fails here:
public static class UserAuthExtensions
{
public static void PopulateMissing(this IUserAuthDetails instance, IAuthTokens tokens, bool overwriteReserved = false)
{
if (instance == null)
throw new ArgumentNullException("instance");
...
if (tokens.Items != null)
{
var items = instance.Items ?? (instance.Items = new Dictionary<string, string>());
tokens.Items.ForEach((x,y) => items[x] = y); // EXCEPTION!
}
PopulateMissingExtended(instance, tokens, overwriteReserved);
}
This is the error I get:
Response Status
Error Code
InvalidOperationException
Message
Collection was modified; enumeration operation may not execute.
Stack Trace
[Authenticate: 6/9/2016 1:40:05 PM]: [REQUEST: {provider:facebook}] System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext() at DictionaryExtensions.ForEach[TKey,TValue](Dictionary`2 dictionary, Action`2 onEachFn) at ServiceStack.Auth.UserAuthExtensions.PopulateMissing(IUserAuthDetails instance, IAuthTokens tokens, Boolean overwriteReserved) at ServiceStack.Auth.RedisAuthRepository`2.CreateOrMergeAuthSession(IAuthSession authSession, IAuthTokens tokens) at ServiceStack.Auth.AuthProvider.OnAuthenticated(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary`2 authInfo) at ServiceStack.Auth.FacebookAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request) at ServiceStack.Auth.AuthenticateService.Authenticate(Authenticate request, String provider, IAuthSession session, IAuthProvider oAuthConfig) at ServiceStack.Auth.AuthenticateService.Post(Authenticate request) at lambda_method(Closure , Object , Object ) at ServiceStack.Host.ServiceRunner`1.Execute(IRequest request, Object instance, TRequest requestDto)
Errors
Please let me know ow to fix this… TIA!