Skip to content

Commit

Permalink
fix: migration syntax and insert query (#2597)
Browse files Browse the repository at this point in the history
  • Loading branch information
zinderic authored Nov 13, 2024
1 parent c2b239d commit 1c26261
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ CREATE TABLE IF NOT EXISTS google_tokens (
access_secret TEXT NOT NULL,
refresh_secret TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) CONFLICT REPLACE
FOREIGN KEY (user_id) REFERENCES users(id)
);

2 changes: 1 addition & 1 deletion projects/sso_auth_axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub async fn refresh_token(email: String) -> Result<u64, ServerFnError> {
.execute(&pool)
.await?;
sqlx::query(
"INSERT INTO google_tokens (user_id,access_secret,refresh_secret) \
"INSERT OR REPLACE INTO google_tokens (user_id,access_secret,refresh_secret) \
VALUES (?,?,?)",
)
.bind(user.id)
Expand Down
2 changes: 1 addition & 1 deletion projects/sso_auth_axum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async fn main() {
let client = oauth2::basic::BasicClient::new(
oauth2::ClientId::new(
std::env::var("G_AUTH_CLIENT_ID")
.expect("G_AUTH_CLIENT Env var to be set."),
.expect("G_AUTH_CLIENT_ID Env var to be set."),
),
Some(oauth2::ClientSecret::new(
std::env::var("G_AUTH_SECRET")
Expand Down

0 comments on commit 1c26261

Please sign in to comment.