Implemented token generation on signin

fix #7