Take a look at the Laravel Authentication Integration docs. When implementing the HasWaterholeUser trait on your application's User model, you will want to override the toWaterholeUser() method so that it only returns a PendingUser object if the user has the correct role that allows them to access the forum:
public function toWaterholeUser(): ?PendingUser
{
if (!$this->roles->contains(ROLE_ID)) {
return null;
}
return new PendingUser(
identifier: $this->getAuthIdentifier(),
email: $this->email,
name: $this->name,
);
}
You don't have permission to do this.
You're going a bit too fast! Take a break and try again in a moment.
Something went wrong! Please reload the page and try again.
Hi @Pete Swan, thanks for your question.
Take a look at the Laravel Authentication Integration docs. When implementing the
HasWaterholeUser
trait on your application'sUser
model, you will want to override thetoWaterholeUser()
method so that it only returns aPendingUser
object if the user has the correct role that allows them to access the forum: