hipsterjazzbo / LaraParse

LaraParse provides a nice integration for using Parse (parse.com) with Laravel 5+
MIT License
27 stars 19 forks source link

Forgot your password link doesn't work #15

Closed cshipley closed 9 years ago

cshipley commented 9 years ago

Is there support in LaraParse for the 'Forgot your password' link in the login screen, or do I have something configured incorrectly?

PDOException in Connector.php line 47: could not find driver

in Connector.php line 47
at PDO->__construct('mysql:host=localhost;dbname=forge', 'forge', '', array('0', '2', '0', false, false)) in Connector.php line 47
at Connector->createConnection('mysql:host=localhost;dbname=forge', array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 20
at MySqlConnector->connect(array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 58
at ConnectionFactory->createSingleConnection(array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 47
at ConnectionFactory->make(array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false), 'mysql') in DatabaseManager.php line 177
at DatabaseManager->makeConnection('mysql') in DatabaseManager.php line 65
at DatabaseManager->connection() in PasswordResetServiceProvider.php line 63
at PasswordResetServiceProvider->Illuminate\Auth\Passwords\{closure}(object(Application), array()) in Container.php line 773
at Container->build(object(Closure), array()) in Container.php line 656
at Container->make('auth.password.tokens', array()) in Application.php line 644
at Application->make('auth.password.tokens') in Container.php line 1231
at Container->offsetGet('auth.password.tokens') in PasswordResetServiceProvider.php line 39
at PasswordResetServiceProvider->Illuminate\Auth\Passwords\{closure}(object(Application), array()) in Container.php line 773
at Container->build(object(Closure), array()) in Container.php line 656
at Container->make('auth.password', array()) in Application.php line 644
nicklee1990 commented 9 years ago

it looks like you haven't changed your PasswordController that comes out of the box with Laravel. You can override as many of the methods inherited from the ResetsPasswords Trait for your needs but the key one is to override the postEmail. My implementation is pretty simple so I actually removed the ResetsPasswords trait as I didn't need it so your implementation might look slightly different. Basically my postEmail looks like this:

/**
 * Request an email password reset
 *
 * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
 */
public function postEmail(Request $request)
{
    $this->validate($request, ['email' => 'required|email']);

    ParseUser::requestPasswordReset(Input::get('email'));
    // Handle the redirecting of the customer any way you like or do additional logic here
    return redirect()->back()->with('status', 'Please check your email for instructions on resetting your password');
}

Note: I don't use try/catch as I have a catch all ParseException handler. It just made things a bit neater!

cshipley commented 9 years ago

Thanks!