Builder icon indicating copy to clipboard operation
Builder copied to clipboard

Starter user registration is broken

Open baradhili opened this issue 6 years ago • 1 comments

when user clicks on activation link, laravel does not activate account and instead asks them to resend activation email..

Solution: change UserService Do not return $userMeta->user()->first() as this will return the first user in the db

Instead

`public function findByActivationToken($token) { $userMeta = $this->userMeta->where('activation_token', $token)->first();

    if ($userMeta) {
        return $userMeta->user();
    }

    return false;
}

`

I should probably fork and submit PRs instead :)

baradhili avatar Feb 02 '19 04:02 baradhili

Actually the fix is in app/Models/UserMeta.php

    public function user()
    {
        return User::where('id', $this->user_id)->first();
    }

should be

    public function user()
    {
        return $this->belongsTo(User::class);
    }

KodeStar avatar Feb 06 '19 12:02 KodeStar