Closed JABirchall closed 8 years ago
You found the solution?
Yeah, your \Config call does not aquired the api key. my fix was just just replace the whole call with the API key
I also made other changes to the code example i made all the Protected members in steaminfo.php public for my own flexability.
I would also suggest you use my alternate method of validating if a user is registered to create etc, as it also supports dual authentication if some devs wish to have that flexibility.
public function steamAuth(SteamAuth $steam)
{
if($steam->validate()) {
$steamInfo = $steam->getUserInfo();
$validator = Validator::make((array)$steamInfo, [
'steamID64' => 'required|numeric',
'nick' => 'required',
'profileURL' => 'required|url',
'profilePicture' => 'url',
]);
if($validator->fails())
return $steam->redirect();
if(Auth::check() === TRUE)// Dual Auth compatibility
$user = Auth::User();
else
$user = User::firstOrNew(['steamId' => $steamInfo->steamID64]);
$user->username = $user->username ?? $steamInfo->nick; //PHP7.0 >= ONLY use isset($user->username) ? $user->username : $steamInfo->nick; if PHP version < 7.0.0.0.0.0.0.0.0.0.*
$user->steamId = $steamInfo->steamID64;
$user->profilePicture = $steamInfo->profilePicture;
$user->profilePictureLarge = $steamInfo->profilePictureFull;
$user->profileURL = $steamInfo->profileURL;
$user->save();
if($user->exists === true)
Auth::login($user, true);
else
return $steam->redirect();
}else
return $steam->redirect();
return redirect('/');
}
+1
The steam API request on line 157 is returning 403 error causing a login loop..
I narrowed the issue down the \Config::get('steam-auth.api_key') is not getting the api-key or putting it in the request URL. Replacing this with the API resolves the issue.