Authentication from scratch. Avoid devise dependency