public function getConfirm($confirmationString) { $user = User::where('confirmationString', $confirmationString)->first(); $success = null; if (!is_null($user)) { $user->confirmed = true; $user->save(); $success = true; } else { $success = false; } return View('auth.successful-confirmation')->with('hideMenu', true)->with('success', $success); }
<?php return ['database' => 'default', 'grant_types' => ['password' => ['class' => '\\League\\OAuth2\\Server\\Grant\\PasswordGrant', 'callback' => function ($username, $password) { if (Auth::validate(['email' => $username, 'password' => $password])) { $user = \Caravel\User::where('email', $username)->first(); return $user->id; } else { return false; } }, 'access_token_ttl' => 3600]], 'token_type' => 'League\\OAuth2\\Server\\TokenType\\Bearer', 'state_param' => false, 'scope_param' => false, 'scope_delimiter' => ',', 'default_scope' => null, 'access_token_ttl' => 3600, 'limit_clients_to_grants' => false, 'limit_clients_to_scopes' => false, 'limit_scopes_to_grants' => false, 'http_headers_only' => false];
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ public function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }