Problem with pending users and null usernames

Topics: Troubleshooting
Developer
Apr 16, 2011 at 1:59 PM
Edited Apr 17, 2011 at 8:37 AM

Hey All,

Is there any reason why the following statement would create a Pending User with no username etc?? i.e. a dummy user?

since upgrading to version 1.1 my module seems to break on the admin index page for user... For some reason when creating an association a new user is created......

this statement returns 2 users when it should return 1

            var users = Services.ContentManager
                .Query<UserPart, UserPartRecord>();

This code creates the association...

            var part = _orchardServices.ContentManager.Create<OpenAuthenticationPart>("User",
                                                                           o => {
                                                                               o.Record.UserId = user.Id;
                                                                               o.Record.ExternalIdentifier = parameters.ExternalIdentifier;
                                                                               o.Record.ExternalDisplayIdentifier = parameters.ExternalDisplayIdentifier;
                                                                               o.Record.OAuthToken = parameters.OAuthToken;
                                                                               o.Record.OAuthAccessToken = parameters.OAuthAccessToken;
                                                                               o.Record.HashedProvider = parameters.HashedProvider;
                                                                           });
            part.ContentItem.ContentManager.Flush();

 

Any ideas gguys?

Cheers,Nick

Developer
Apr 17, 2011 at 8:37 AM
Edited Apr 17, 2011 at 8:42 AM

Anyone?? any ideas on why a pending user is created?

Developer
Apr 17, 2011 at 1:28 PM

Solved.

Apr 17, 2011 at 4:25 PM

You could share your solution for others benefit ... personally I haven't used the Open Authentication module, although issues with it would normally be best directed at that module's website or owners (unless it appears linked to a problem specifically in Orchard core!) But I'm sure sooner or later someone will hit the same problem and you might as well post an answer here in case anyone comes looking ... ;)