Skip to content

Instantly share code, notes, and snippets.

@nclundsten
Created December 7, 2015 20:48
Show Gist options
  • Save nclundsten/c74cf7383befda8f0500 to your computer and use it in GitHub Desktop.
Save nclundsten/c74cf7383befda8f0500 to your computer and use it in GitHub Desktop.
index 9c31b84..6376a42 100644
--- a/module/RegisterInvite/src/Service/RegisterInviteService.php
+++ b/module/RegisterInvite/src/Service/RegisterInviteService.php
@@ -15,21 +15,16 @@ class RegisterInviteService
throw new RegisterException('no invite');
}
- return $this->getServiceLocator()->get('zfcuser_register_form');
+ $form = $this->getServiceLocator()->get('zfcuser_register_form');
+ $form->get('user_id')->setValue($tokenInfo['generic_id']);
+ return $form;
}
- public function storeToken($token)
+ //expects tokenservice to return false if no token or expired
+ public function generateToken($userId)
{
- return $this->getTokenService()
- //NOTE: this may not be the right method name, or correct order of params (TBA)
- ->storeToken($this->getTokenType(), $token);
- }
-
- public function getToken($token)
- {
- return $this->getTokenService()
- //NOTE: this may not be the right method name, or correct order of params (TBA)
- ->getToken($this->getTokenType(), $token);
+ //return token row (model representation or array) //will include expiration time and token
+ return $this->getTokenService()->generateToken($this->getTokenType(), $userId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment