Skip to content

Commit

Permalink
feat: remove consent prompt on request (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyJanson authored Feb 1, 2023
1 parent 7781228 commit 11f6a8d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class Provider extends AbstractProvider
'email',
];

/**
* {@inheritdoc}
*/
protected $consent = false;

/**
* {@inheritdoc}
*/
Expand All @@ -34,6 +39,32 @@ protected function getAuthUrl($state)
);
}

/**
* {@inheritdoc}
*/
protected function getCodeFields($state = null)
{
$fields = parent::getCodeFields($state);

if (!$this->consent) {
$fields['prompt'] = 'none';
}

return $fields;
}

/**
* Prompt for consent each time or not.
*
* @return $this
*/
public function withConsent()
{
$this->consent = true;

return $this;
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 11f6a8d

Please sign in to comment.