Fix unit test and add extension method
Enable foreign key for user logins