mguinness / IdentityManagerUI

Identity management system for ASP.NET Core Identity.
MIT License
228 stars 63 forks source link

Users.cshtml has ajax error and doesn't load any data #16

Closed zrupcic closed 1 year ago

zrupcic commented 1 year ago

Upon loading /IdentityManager/Home/Users locally, I get this popup message:

DataTables warning: table id=usersTable - Ajax error. For more information about this error, please see http://datatables.net/tn/7

Chrome console gives me this error: Request URL: https://localhost:44385/api/UserList?draw=1&columns[0][data]=id&columns[0][name]=&columns[0][searchable]=true&columns[0][orderable]=true&columns[0][search][value]=&columns[0][search][regex]=false&columns[1][data]=email&columns[1][name]=&columns[1][searchable]=true&columns[1][orderable]=true&columns[1][search][value]=&columns[1][search][regex]=false&columns[2][data]=userName&columns[2][name]=&columns[2][searchable]=true&columns[2][orderable]=true&columns[2][search][value]=&columns[2][search][regex]=false&columns[3][data]=displayName&columns[3][name]=&columns[3][searchable]=true&columns[3][orderable]=false&columns[3][search][value]=&columns[3][search][regex]=false&columns[4][data]=roles&columns[4][name]=&columns[4][searchable]=true&columns[4][orderable]=false&columns[4][search][value]=&columns[4][search][regex]=false&columns[5][data]=lockedOut&columns[5][name]=&columns[5][searchable]=true&columns[5][orderable]=false&columns[5][search][value]=&columns[5][search][regex]=false&order[0][column]=0&order[0][dir]=asc&start=0&length=10&search[value]=&search[regex]=false&_=1678181358606 Request Method: GET Status Code: 500 Remote Address: [::1]:44385 Referrer Policy: strict-origin-when-cross-origin

The datatables.net link above says that the problem might be related with browsers preventing loading external scripts from localhost, but Roles.cshtml loads without errors and /api/RoleList gives back status code of 200.

Can anyone help me figure out what's going on?

mguinness commented 1 year ago

You're getting 500 Internal Server Error on /api/UserList endpoint. I suggest you put a breakpoint on the following function and see what exception is being raised.

https://github.com/mguinness/IdentityManagerUI/blob/3715c488c82cdef4c0b262357821bd0874dfc9bd/IdentityManagerUI/Areas/IdentityManager/Controllers/HomeController.cs#L52

zrupcic commented 1 year ago

Thanks, I will try to debug the issue.

zrupcic commented 1 year ago

Issue resolved.