From 55e97106e9a7288a97d917d446f948ab257f2ced Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 11 Mar 2020 10:12:33 -0400 Subject: [PATCH] Fix GenerateOAuthState() query for SQLite --- database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database.go b/database.go index cea7a97..6beea1a 100644 --- a/database.go +++ b/database.go @@ -2512,7 +2512,7 @@ func (db *datastore) GetCollectionLastPostTime(id int64) (*time.Time, error) { func (db *datastore) GenerateOAuthState(ctx context.Context, provider, clientID string) (string, error) { state := store.Generate62RandomString(24) - _, err := db.ExecContext(ctx, "INSERT INTO oauth_client_states (state, provider, client_id, used, created_at) VALUES (?, ?, ?, FALSE, NOW())", state, provider, clientID) + _, err := db.ExecContext(ctx, "INSERT INTO oauth_client_states (state, provider, client_id, used, created_at) VALUES (?, ?, ?, FALSE, "+db.now()+")", state, provider, clientID) if err != nil { return "", fmt.Errorf("unable to record oauth client state: %w", err) }