Made login into a stored procedure

Actually works now