Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

teampoison's avatar

After account create showing user not found if i again login then successul login vue js

After account create showing user not found if i again login then successul login. In my account creation form their are two form are used. in one form user put email and password.

<form @submit.prevent="btn_action" class="login100-form validate-form">
          <span class="login100-form-title p-b-18">Sign Up</span>
          <span style="color:#495057" class="m-b-10 m-t-10 ">{{ user_msg }}</span>
          <span style="color:green" v-if="in_step == 'three'" class="m-b-10 m-t-10">Email verified successfully.</span>
          <br />
          <br />
          <span style="color:#495057" v-if="in_step == 'three'">Enter your phone no which will be used as a login id for
            your account.</span>
          <div class="wrap-input100 validate-input m-b-10 m-t-10" v-if="is_show_email_input"
            data-validate="Username is reauired">
            <span class="label-input100 "></span>
            <input class="input100" type="text" v-model="email" name="email" placeholder="Email" @blur="validateEmail"/>
            <span class="focus-input100 icon-pos" data-symbol=""></span>
          </div>
          <div class="wrap-input100 validate-input m-b-10 m-t-18" v-if="is_show_email_input">
          
            <input class="input100" type="password" v-model="password" name="password" placeholder="Password"
              pattern="(?=.*\d)(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,}"
              title="Password must contain at least one number, one special character(!@#$%^&*),  one uppercase and lowercase letter, and length of 8 to 15 characters"
              maxlength="15" />
            <span class="focus-input100 icon-pos" data-symbol=""></span>
          </div>
          <div class="wrap-input100 validate-input m-b-10 m-t-18" v-if="is_show_email_input">

            <input class="input100" type="password" v-model="confirm_password" name="confirm_password"
              placeholder="Confirm Password" />
            <span class="focus-input100 icon-pos" data-symbol=""></span>
          </div>
</form>

After that new user redirect to different form where we ask some details

<form
          @submit.prevent="member_whitelist_signup"
          class="login100-form validate-form"
        >
<div class="col-sm-6">
              <div class="wrap-input100 validate-input m-b-20" data-validate>
                <span class="label-input100">Waist (In Inches)</span>
                <input
                  class="input100"
                  type="number"
                  v-model="waist"
                  name="waist"
                  min="20"
                  max="80"
                />
                <span class="focus-input100" data-symbol=""></span>
              </div>
            </div>
          </div>

          <span style="color: red" class="m-b-10 m-t-10">{{ error_msg }}</span>

          <div class="container-login100-form-btn m-t-20 m-b-10">

            <div
              class="wrap-login100-form-btn"
              style="z-index: 0"
              
            >

              <div class="login100-form-bgbtn"></div>
              <button class="login100-form-btn" type="submit" @click="handleButtonClick(true)">Submit</button>
            </div>
          </div>

          
          <div class="container-login100-form-btn m-t-10 m-b-10">
            <p
              
              class="know_your_risk_label text-secondary"
            >
              <button class="login100-form-btn know-risk-text text-black" type="submit" @click="handleButtonClick(false)" name="risk">Know your risk</button>
            </p>
          </div>

          <div class="flex-col-c"></div>

        </form>

After that account are created and redirect to another page but account not automatic login on console showing user not found with this email address.

Again i add this email and password in login form then account login

0 likes
2 replies
LaryAI's avatar
Level 58

It seems like the issue is with the authentication process after the account creation. The user is not being logged in automatically and is required to log in again with the same credentials.

To solve this issue, you can try the following steps:

  1. After the account creation, log in the user using the same credentials. You can use Laravel's built-in authentication system to log in the user.

  2. Once the user is logged in, redirect them to the desired page.

Here's an example of how you can log in the user after the account creation:

// Assuming you have the user's email and password
$email = '[email protected]';
$password = 'password';

// Attempt to authenticate the user
if (Auth::attempt(['email' => $email, 'password' => $password])) {
    // Authentication successful, redirect to desired page
    return redirect('/dashboard');
} else {
    // Authentication failed, handle the error
    return redirect('/login')->with('error', 'Invalid credentials');
}

Make sure to include the Auth facade at the top of your file:

use Illuminate\Support\Facades\Auth;

With this code, you can log in the user after the account creation and redirect them to the dashboard page. If the authentication fails, you can redirect the user to the login page with an error message.

Hope this helps!

Snapey's avatar

Do you think you might have forgot to post the code that actually does the work?

Please or to participate in this conversation.