Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on UserManager.FindById #13

Open
joshgarwood opened this issue Mar 20, 2014 · 1 comment
Open

Error on UserManager.FindById #13

joshgarwood opened this issue Mar 20, 2014 · 1 comment

Comments

@joshgarwood
Copy link

When running this code:

UserManager.FindById(User.Identity.GetUserId())

I get an error stating that "some guid" is not a valid 24 digit hex string... Right now GetUserId seems to be returning a Guid as a string. If I change this to be:

UserManager.FindById(MongoDB.Bson.ObjectId.GenerateNewId().ToString())

... It works as expected. The problem is that obviously this won't work in the real world, but it does seem that FindById is expecting an ObjectId.

Am I missing something?

Thanks!

@jsheely
Copy link
Contributor

jsheely commented Apr 7, 2014

The Id is an ObjectId which would need to be a string in order for the ObjectId.Parse() function doesn't fail. This is one of the issues that I'm trying to address in the V2 implementation of the AspNet Identity provider.

Hopefully I'll get it worked out soon so you can use other concrete types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants