Laravel 5.1蒸汽登录

时间:2015-07-29 10:42:48

标签: php laravel steam

也许有人知道原因,github invisik laravel steam auth 登录后,我被重定向到:

  

MYDOMAIN。   COM / openid.ns = HTTP%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&安培; openid.mode = id_res&安培; openid.op_endpoint = HTTPS%3A%2F%2Fsteamcommunity.com%2Fopenid%2Flogin&安培;的OpenID .claimed_id = HTTP%3A%2F%2Fsteamcommunity.com%2

有人可以告诉我问题在哪里吗?

1 个答案:

答案 0 :(得分:6)

我有一个视频,如果这有助于https://www.youtube.com/watch?v=rfHX-Hecu3k&feature=youtu.be

我有同样的问题这是修复

确定你的 config / steam-auth.php 看起来像这样,使用redirect_url作为/ login

<?php

return [

    /*
     * Redirect url after login
     */
    'redirect_url' => '/login',
    /*
     *  Api Key (http://steamcommunity.com/dev/apikey)
     */
    'api_key' => 'Your_API_KEY'

];

此外,如果您希望将其保存到users表下的数据库,请将这些内容添加到 Create_User_table Migration 。您不必拥有名称和内容,只需确保您拥有&#39;昵称&#39; &#39;化身&#39; &#39; steamid&#39;

public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nickname');
            $table->string('avatar');
            $table->string('steamid')->unique();
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password', 60);
            $table->rememberToken();
            $table->timestamps();
        });
    }

您还需要转到控制器中的Auth目录,然后进入 AuthController.php 并将这些行添加到&#34; protected function create(array $ data) )&#34;

protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'nickname' => $data['nickname'],
            'steamid' => $data['steamid'],
            'avatar' => $data['avatar'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }
}

还必须编辑可在App Directory中找到的 User.php 。 您需要添加&#39;用户名&#39; &#39;化身&#39; &#39; steamid&#39; &#34;受保护的$ fillable&#34;

     /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name', 'email', 'username', 'avatar', 'steamid', 'password'];