incorrect logic for isAdmin

I was failing authentication this "~window.user.roles.indexOf('admin');" seems completely incorrect. 
->Negate the index of ('admin') I kept getting -1 for the isAdmin function and it should have been true. Or am I missing something here?