/** * Adds an auth token to a given Student instance. * * Warning: This method wil overwrite the existing auth token. * * @param Student $student Student entity with an auth token. */ public function createAuthToken(Student $student) { return $student->setToken(StringUtils::generate(65)); }
/** * Constructor. Randomly generates new CSRF token every time this method is called. */ public function __construct() { $this->csrfToken = StringUtils::generate(50); }