Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL exception at logout #48

Open
Crouxie opened this issue Mar 9, 2022 · 2 comments
Open

SQL exception at logout #48

Crouxie opened this issue Mar 9, 2022 · 2 comments

Comments

@Crouxie
Copy link

Crouxie commented Mar 9, 2022

Hi,

your package v1.x returns SQL error at logout:

Illuminate\Database\QueryException
SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]A column has been specified more than once in the order by list. Columns in the order by list must be unique. (SQL: select top 1 * from [authentication_log] where [authentication_log].[authenticatable_type] = App\User and [authentication_log].[authenticatable_id] = 3 and [authentication_log].[authenticatable_id] is not null and [ip_address] = ::1 and [user_agent] = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 order by [login_at] desc, [login_at] desc)

which can be resolved by replacing:
$log = $user->authentications()->whereIpAddress($ip)->whereUserAgent($userAgent)->orderByDesc('login_at')->first();
with
$log = $user->authentications()->whereIpAddress($ip)->whereUserAgent($userAgent)->first();

@lrljoe
Copy link
Collaborator

lrljoe commented Aug 16, 2024

Is this still a problem, or has it been fixed in a subsequent release?

@rebecajuliaa9
Copy link

I am still facing the same problem.

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

No branches or pull requests

3 participants