daniel-de-wit / lighthouse-sanctum

Laravel Sanctum support for Laravel Lighthouse
MIT License
56 stars 9 forks source link

Is it possible to localize messages in Login class, not editing in vendor folder #92

Open delirium15 opened 1 year ago

delirium15 commented 1 year ago

In Logout and Register classes there are used something like "translator", for example $message = $this->translator->get('Your session has been terminated');

But in Login it looks like messages are hard coded.. Couldn't find info how can translate validation messages..

if (! $user || ! $userProvider->validateCredentials($user, $args)) { throw new AuthenticationException('The provided credentials are incorrect.'); }

if ($user instanceof MustVerifyEmail && ! $user->hasVerifiedEmail()) { throw new AuthenticationException('Your email address is not verified.'); }

wimski commented 1 year ago

I think this is related to https://github.com/daniel-de-wit/lighthouse-sanctum/pull/71