qor / qor-example

An example application showcasing the QOR SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error 1054: Unknown column 'basic.provider' in 'where clause'

fym201 opened this issue · comments

When admin login:

(D:/dev/go_path/src/github.com/qor/auth/providers/password/handlers.go:27) 
[2018-09-17 13:10:58]  Error 1054: Unknown column 'basic.provider' in 'where clause' 

(D:/dev/go_path/src/github.com/qor/auth/providers/password/handlers.go:27) 
[2018-09-17 13:10:58]  [0.00ms]  SELECT * FROM `auth_identity`  WHERE `auth_identity`.`deleted_at` IS NULL AND ((`basic`.`provider` = 'password') AND (`basic`.`uid` = 'dev@getqor.com'))  
[0 rows affected or returned ] 

(D:/dev/go_path/src/github.com/qor/auth/user_storer.go:45) 
[2018-09-17 13:10:58]  Error 1054: Unknown column 'basic.provider' in 'where clause' 

(D:/dev/go_path/src/github.com/qor/auth/user_storer.go:45) 
[2018-09-17 13:10:58]  [1.00ms]  SELECT * FROM `auth_identity`  WHERE `auth_identity`.`deleted_at` IS NULL AND ((`basic`.`provider` = 'password') AND (`basic`.`uid` = 'dev@getqor.com')) ORDER BY `auth_identity`.`id` ASC LIMIT 1  
[0 rows affected or returned ] 

(D:/dev/go_path/src/github.com/qor/auth/user_storer.go:51) 
[2018-09-17 13:10:58]  [1.00ms]  SELECT * FROM `user`  WHERE `user`.`deleted_at` IS NULL ORDER BY `user`.`id` ASC LIMIT 1  
[1 rows affected or returned ] 
failed to find template: auth/confirmation.text
TO: <dev@getqor.com>
Subject: Please confirm your account

Content-Type: text/html; charset=UTF-8
<p>Please click on the below link to validate your email address:</p>

<p><a href="http://127.0.0.1:7000/auth/password/confirm?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm92aWRlciI6InBhc3N3b3JkIiwianRpIjoiZGV2QGdldHFvci5jb20iLCJzdWIiOiJjb25maXJtIn0.ncDEASnJj6mfw0xcKFBXecvvmMkcLcM-T6_KFlHc9h8">http://127.0.0.1:7000/auth/password/confirm?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm92aWRlciI6InBhc3N3b3JkIiwianRpIjoiZGV2QGdldHFvci5jb20iLCJzdWIiOiJjb25maXJtIn0.ncDEASnJj6mfw0xcKFBXecvvmMkcLcM-T6_KFlHc9h8</a></p>

I'm starting to get this also. And when one uses the confirmation link, one gets feedback saying that that the account is confirmed; however, upon login, it continues to ask one to confirm with the link.
Wtf?

Also having this issue. When I attempt to log in with the dev admin user, it tells me that I need to confirm my email address. When I attempt to 'register' a new user, I get a feedback error on the UI saying "invalid account".

Bump.
In my opinion, it is important, nay imperative, that the example application work. Otherwise, possible new users will be driven away and this library will just get a bad rap on other boards.
I don't want that; I love this library, and I reply upon regularly spinning up the latest commit of the example application to pour through the code and learn how to use the libraries (or even new tricks I was unaware of).
When it feels like there wasn't even any testing done before pushing out a new commit, it is kind of a turn-off and makes me feel like looking elsewhere. Which I don't want to do and I want to keep recommending QoR... but I'm hamstrung if I show it off and a colleague gets into it and spins up the example application... only to have it not work. And this ticket has been open quite some time; I'm assuming qor-example has been broken for even longer than that; I would figure of all things someone would jump on this issue quick as it is a huge outward-facing coffee-stain on the face of these excellent libraries.

Same here in linux:

(Error 1054: Unknown column 'basics.provider' in 'where clause')
[2018-10-27 19:34:48]

(Error 1054: Unknown column 'basics.provider' in 'where clause')
[2018-10-27 19:34:48]
failed to find template: auth/confirmation.text
TO: dev@getqor.com
Subject: Please confirm your account

Content-Type: text/html; charset=UTF-8

Please click on the below link to validate your email address:

http://localhost:7000/auth/password/confirm?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm92aWRlciI6InBhc3N3b3JkIiwianRpIjoiZGV2QGdldHFvci5jb20iLCJzdWIiOiJjb25maXJtIn0.ncDEASnJj6mfw0xcKFBXecvvmMkcLcM-T6_KFlHc9h8

For a quick fix: #155

I think the correct fix is to change the type on line 17 from Basic to AuthIdentity:
https://github.com/qor/auth/blob/2bfb79d9618566322a4e5e9b6664eefb9f49f427/providers/password/handlers.go#L17

Change to:

authInfo    auth_identity.AuthIdentity

I gave up on Qor for some months, mostly because it doesn't seem that the ThePlant is interested in making qor-example like, actually work.

However, I came back to give Qor one more try and saw your post @Neopallium ; now all the problems in this issue are gone for me. Thanks!

This bug relevant for now. Maybe should fix it?

This issue is still present. Tested in both Linux and Windows. Did the Neopallium suggested change on line 17 from Basic to AuthIdentity. and still the same Error 1054: Unknown column 'basics.provider' in 'where clause'

I did a fresh install and tried the @Neopallium fix (that I could have sworn worked for me last time) and now I still have the same issue Error 1054: Unknown column 'basics.provider' in 'where clause'.
Hard to believe this is still an issue. This prevents the email data from even showing up in the console, so can't move forward. @jinzhu it would be cool if this was fixed.

@tadeogutierrez finally go it to work:

in qor\auth\providers\password\handlers.go I replaced all references to Basic to AuthIdentity, then I applied for a new account, then I cut and pasted the link from the email text in the console into a browser and got the account confirmed notification, then logged into the MySql database and updated role to Admin in the users table and NOW it works.