Registration (register using link /register) and Login algorithms