0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CakePHP3.xでLoginActionに値を渡すと弾かれる対策

Posted at

CakePHPでAuthコンポーネントを使用した認証を作成する際、
ログインページのURLに値を持たせてログイン処理を制御しようとしたらはまったのでメモ。

(例) /users/login // ok
/users/login/1 // ng

ログインに使用するアクションの判定はURLで行っているらしく、
余計な値を持たせると別ページと判断されてしまうみたい。

対象コントローラのinitialize()で、
$this->Auth->allow(['login']);
と書きloginアクションを認証の対象外にすることで対処できた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?