Colin Mackie - 18 - Mar 27, 2015

Is there a preferred way to delete a user from an IAuthRepository,?

There isn’t an API for this, what AuthProvider impl are you using?

Colin Mackie:

A bunch of OAuth ones and a CredentialsAuthProvider in OrmLite. Just came across a need to remove a user and couldn’t see an obvious way to do it.

My mistake, I mean which AuthProviderRepo are you using?

Colin Mackie:


You can just use OrmLite to delete the userAuth rows, e.g:

db.Delete<UserAuth>(x => x.Id == userId);
db.Delete<UserAuthDetails>(x => x.UserAuthId == userId);

and if you have any roles:

db.Delete<UserAuthRole>(x => x.UserAuthId == userId);

Colin Mackie:

Ok, thanks. Glad I wasn’t missing something. Will that change? Seems that the logic and structure of the auth tables shouldn’t be outside of the auth classes and have to be manipulated directly.

Yep, just added new DeleteUserAuth() for existing Auth Repo’s in this commit:

This change just finished deploying to MyGet: