Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Starter user registration is broken #203

Open
baradhili opened this issue Feb 2, 2019 · 1 comment
Open

Starter user registration is broken #203

baradhili opened this issue Feb 2, 2019 · 1 comment

Comments

@baradhili
Copy link

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 :)

@KodeStar
Copy link

KodeStar commented Feb 6, 2019

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);
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants