teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

書式の改善

2015/10/15 23:29

投稿

退会済みユーザー
answer CHANGED
@@ -1,12 +1,13 @@
1
1
  認証に使用するカラム名の指定が有りません。
2
2
  Authコンポーネントがデフォルトで使用するカラム名は下記の通りです。
3
+
3
4
  ユーザー名:username
4
5
  パスワード:password
5
6
 
6
7
  ソースコードの例で言うとmail_addressとpasswordをカラム名として使用しているようですので、
7
8
  Authコンポーネントの設定にその指定を追加して下さい。
8
-
9
+ ```PHP
9
- public $components = array(
10
+ public $components = array(
10
11
  'Auth' => array(
11
12
  'loginAction' => array(
12
13
  'controller' => 'users',
@@ -26,13 +27,15 @@
26
27
  'Form' => array(
27
28
  'passwordHasher' => 'Blowfish',
28
29
  'hashType' => 'sha1',
30
+ 'fields' => array(
29
- 'fields' => array( 'username' => 'mail_address'
31
+ 'username' => 'mail_address',
30
- , 'password' => 'password')
32
+ 'password' => 'password')
31
33
  )
32
34
  )
33
35
 
34
36
  )
35
37
  );
38
+ ```
36
39
 
37
40
 
38
41
 

1

推敲

2015/10/15 23:29

投稿

退会済みユーザー
answer CHANGED
@@ -3,7 +3,8 @@
3
3
  ユーザー名:username
4
4
  パスワード:password
5
5
 
6
- ソースコードの例で言うとmail_addressとpasswordをカラム名として使用しているようですので、Authの設定にその指定を追加して下さい。
6
+ ソースコードの例で言うとmail_addressとpasswordをカラム名として使用しているようですので、
7
+ Authコンポーネントの設定にその指定を追加して下さい。
7
8
 
8
9
  public $components = array(
9
10
  'Auth' => array(