Instantiating if null
At the very least, you should place the second if statement in a finally block.  As things stand, the code is not generally correct from a purely mechanical perspective.  I would also phrase it as:

bool dbDispose = db == null;
db = db ?? new DataContext();


From a design point of view: yes, I'd say this violates the single responsibility principle.  You have a method that not only does certain calculations, but also creates a DataContext if necessary.  If creation has to be modified at any point, then you'll have many places to change that.  (Unlikely if it's default-constructed like this, but I doubt it's that simple in practice.)

It looks to me like SignIn should actually be a member function of DataContext.