1
votes

I have my signup controller code.

public function actionSignup()
{
    $model = new SignupForm();
    if ($model->load(Yii::$app->request->post()) && $model->validate()) {
        if ($user = $model->signup()) {
            $this->layout = 'index';
                return $this->goHome();
        }
    }
    $this->layout = 'index';
    return $this->render('signup', [
        'model' => $model,
    ]);
}

When i, through url pass the address as index.php?r=site/login then there appears login form & that works fine. But when i pass as index.php?r=site/signup then it shows me above error. I am not getting this....

1
Are you already authenticated ? - soju
i am not getting you... - user4331629
Could you please update your question with your accessControl filter? - Ali MasudianPour
Signup action is usually for guests, if you are already authenticated you will get a 403 error. - soju
@soju I got what you are talking....i just cleared cookies & all the enabled session & tried signup through typing fresh url. now its working. Actually last time i have closed the page directly to try it in another tab...the session was active may be that reason but now it is working. - user4331629

1 Answers

0
votes

Signup action is for guests, you get this 403 error because you are already authenticated.