[PR #238] [CLOSED] Attempt 1 at simplifying the token reauth #332

Closed
opened 2026-02-27 20:24:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/238
Author: @marioortizmanero
Created: 8/7/2021
Status: Closed

Base: masterHead: refresh-token-simpler


📝 Commits (10+)

  • 092b153 Change function signature of get_token and get_token_mut to async.
  • 21a9339 Change the function signature of get_token and get_token_mut
  • bdbf3ef Remove mut from get_token_mut.
  • b8a6abd Remove mut from request_token and refresh_token
  • c54ec04 Automatically re-authenticate.
  • 03050a0 Optimze get_token flow.
  • c50c2dd Add a new function auto_reauth for OAuthClient trait.
  • 04c88b8 Fix compile error.
  • b97552c webapp example upgrade rocket to 0.5
  • c563f5d update refresh-token.rs.

📊 Changes

17 files changed (+462 additions, -124 deletions)

View changed files

📝 CHANGELOG.md (+3 -1)
📝 Cargo.toml (+10 -0)
📝 examples/oauth_tokens.rs (+6 -3)
examples/ureq/threading.rs (+45 -0)
📝 examples/webapp/Cargo.toml (+3 -3)
📝 examples/webapp/src/main.rs (+37 -36)
examples/with_auto_reauth.rs (+109 -0)
📝 examples/with_refresh_token.rs (+7 -4)
📝 src/auth_code.rs (+43 -23)
📝 src/auth_code_pkce.rs (+48 -16)
📝 src/client_creds.rs (+38 -12)
📝 src/clients/base.rs (+69 -12)
📝 src/clients/mod.rs (+3 -3)
📝 src/clients/oauth.rs (+14 -5)
📝 src/lib.rs (+22 -1)
📝 tests/test_oauth2.rs (+4 -4)
📝 tests/test_with_oauth.rs (+1 -1)

📄 Description

This is a WIP attempt to simplify the code at #224


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/238 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 8/7/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `refresh-token-simpler` --- ### 📝 Commits (10+) - [`092b153`](https://github.com/ramsayleung/rspotify/commit/092b15398e245a9d8d9780e929992074b6e4327b) Change function signature of `get_token` and `get_token_mut` to async. - [`21a9339`](https://github.com/ramsayleung/rspotify/commit/21a9339073988649aac5b89ffc757b2d00735608) Change the function signature of `get_token` and `get_token_mut` - [`bdbf3ef`](https://github.com/ramsayleung/rspotify/commit/bdbf3ef142200f243b912e27b79da27b53ebffbe) Remove `mut` from `get_token_mut`. - [`b8a6abd`](https://github.com/ramsayleung/rspotify/commit/b8a6abd27cb1502081e38c125672bd827277d659) Remove `mut` from `request_token` and `refresh_token` - [`c54ec04`](https://github.com/ramsayleung/rspotify/commit/c54ec047ea1220d4be9af2536fa9d5fdad50b56d) Automatically re-authenticate. - [`03050a0`](https://github.com/ramsayleung/rspotify/commit/03050a0e5d40ca4753e71923d356f28f4dfb0b77) Optimze get_token flow. - [`c50c2dd`](https://github.com/ramsayleung/rspotify/commit/c50c2dd25e4487aa63b55b3bfd077965a54b236a) Add a new function `auto_reauth` for OAuthClient trait. - [`04c88b8`](https://github.com/ramsayleung/rspotify/commit/04c88b8224264c72f03cb72c6c2144eafe0926cd) Fix compile error. - [`b97552c`](https://github.com/ramsayleung/rspotify/commit/b97552c98706d765e3eb5a540f36c6b9ad91c538) webapp example upgrade rocket to 0.5 - [`c563f5d`](https://github.com/ramsayleung/rspotify/commit/c563f5d2887b7bc295eb5c935299a8d71206bf8e) update refresh-token.rs. ### 📊 Changes **17 files changed** (+462 additions, -124 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -1) 📝 `Cargo.toml` (+10 -0) 📝 `examples/oauth_tokens.rs` (+6 -3) ➕ `examples/ureq/threading.rs` (+45 -0) 📝 `examples/webapp/Cargo.toml` (+3 -3) 📝 `examples/webapp/src/main.rs` (+37 -36) ➕ `examples/with_auto_reauth.rs` (+109 -0) 📝 `examples/with_refresh_token.rs` (+7 -4) 📝 `src/auth_code.rs` (+43 -23) 📝 `src/auth_code_pkce.rs` (+48 -16) 📝 `src/client_creds.rs` (+38 -12) 📝 `src/clients/base.rs` (+69 -12) 📝 `src/clients/mod.rs` (+3 -3) 📝 `src/clients/oauth.rs` (+14 -5) 📝 `src/lib.rs` (+22 -1) 📝 `tests/test_oauth2.rs` (+4 -4) 📝 `tests/test_with_oauth.rs` (+1 -1) </details> ### 📄 Description This is a WIP attempt to simplify the code at #224 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#332
No description provided.