Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Commit

Permalink
Added reminders for each individual type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ollie Read committed Aug 27, 2014
1 parent ce04fe0 commit d64abcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
7 changes: 2 additions & 5 deletions src/Ollieread/Multiauth/Reminders/PasswordBrokerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ class PasswordBrokerManager {

protected $brokers = array();

public function __construct(ReminderRepositoryInterface $reminders,
Mailer $mailer,
$reminderView,
$providers)
public function __construct(ReminderRepositoryInterface $reminders, Mailer $mailer, $reminderViews, $providers)
{
foreach($providers as $type => $provider) {
$this->brokers[$type] = new PasswordBroker($type, $reminders, $provider, $mailer, $reminderView);
$this->brokers[$type] = new PasswordBroker($type, $reminders, $provider, $mailer, $reminderViews[$type]);
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/Ollieread/Multiauth/Reminders/ReminderServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,19 @@ protected function registerPasswordBroker()
// for the given e-mail addresses. We will resolve an implementation here.
$reminders = $app['auth.reminder.repository'];

$providers = array();
$providers = $views = array();

foreach($app['config']['auth.multi'] as $type => $config) {
$providers[$type] = $app['auth']->$type()->driver()->getProvider();
$views[$type] = $config['email'] ? $config['email'] : $app['config']['auth.reminder']['email'];
}

$view = $app['config']['auth.reminder.email'];

// The password broker uses the reminder repository to validate tokens and send
// reminder e-mails, as well as validating that password reset process as an
// aggregate service of sorts providing a convenient interface for resets.
return new PasswordBrokerManager(

$reminders, $app['mailer'], $view, $providers
$reminders, $app['mailer'], $views, $providers

);
});
Expand Down

0 comments on commit d64abcb

Please sign in to comment.