title: How to create login and signup actions in yii2 API
body: <p>I am working on yii2 api and want to create the user login and user register/signup,but I don't know how to create the login and signup in API</p>
  
  <p>I can GET the values from User, but how the login and signup will work when yii2 will work with iOS application?</p>
  
  <p>this is my code for user controller, 
      
  
  <pre><code>namespace api\modules\v1\controllers;
  use Yii;
  use yii\data\ActiveDataProvider;
  use yii\rest\ActiveController;
  use api\modules\v1\models\User; 
  use yii\web\Response;
  use yii\web\JsonResponseFormatter;
  
  /**
   * UserController implements the CRUD actions for User model.
   */
  class UserController extends ActiveController
  {
    public function behaviors(){
                  $behaviors = parent::behaviors();
                  $behaviors['bootstrap'] = [
                  'class' =&gt; \yii\filters\ContentNegotiator::className(),
                  'formats' =&gt; [
                      'application/json' =&gt; Response::FORMAT_JSON,
                  ],               
              ];
                  return $behaviors;
          }
  
  
      public $modelClass = 'api\modules\v1\models\User';   
  
     public function actionUserapi()
      {
          Yii::$app-&gt;response-&gt;format = Response::FORMAT_JSON;
           return new ActiveDataProvider([
              'query' =&gt; User::find()-&gt;asArray()
          ]);
      }
  }
  </code></pre>