-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CO-2677 - Add capability to generate, print, and delete Privacy Idea backup codes as an authenticator for a CO Person #525
base: develop
Are you sure you want to change the base?
Conversation
*/ | ||
|
||
public function generate() { | ||
if($this->request->is('get')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since everything happens inside an if you should better reverse the logic.
public function generate() {
if(!$this->request->is('get')) {
// what to return here??
}
// the rest of the logic
}
case PrivacyIDEATokenTypeEnum::TOTP: | ||
$token['confirmed'] = false; | ||
$TotpToken = new TotpToken(); | ||
$TotpToken->save($token); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen if save fails?
break; | ||
} | ||
|
||
if(!$jresponse->result->status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably not needed. The same check exists at line 193
$results = $this->TotpToken->find('all', $args); | ||
|
||
if(empty($results)) { | ||
unset($args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer not to unset the $args but to re-initialize it.
$args = array();
…es as an authenticator for a CO Person
rebased again latest develop |
…es as an authenticator for a CO Person