[PR #418] [MERGED] Add token fetch callback #442

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

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/418
Author: @ramsayleung
Created: 5/27/2023
Status: Merged
Merged: 6/18/2023
Merged by: @ramsayleung

Base: masterHead: ramsay/add_token_callback_support


📝 Commits (10+)

  • 6de9fb3 Add token fetch callback support
  • 9eb5336 Add token callback function support for AuthCodeSpotify
  • a2347de Add token callback function for AuthCodePkceSpotify
  • 9babacb Add token callback support for ClientCredSpotify
  • 50dc9bf Add example to test
  • 13b4b13 Update CHANGELOG
  • 365b74d cargo fmt code
  • d0ba817 fix clippy error
  • 8c71294 Update gitignore
  • f8ffc61 Change the function signature of callback function

📊 Changes

9 files changed (+158 additions, -3 deletions)

View changed files

📝 .gitignore (+1 -1)
📝 CHANGELOG.md (+1 -0)
📝 Cargo.toml (+5 -0)
📝 clippy.toml (+1 -1)
examples/with_token_callback_fn.rs (+100 -0)
📝 src/auth_code.rs (+10 -0)
📝 src/auth_code_pkce.rs (+10 -0)
📝 src/client_creds.rs (+5 -0)
📝 src/lib.rs (+25 -1)

📄 Description

Description

Add a user-customized callback function support which is invoked whenever client succeeds to request or refresh a token, so it provides users an opportunity to save token into file, store into database etc.

Motivation and Context

#400

Dependencies

None

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • with_token_callback_fn.rs

Is this change properly documented?

Please make sure you've properly documented the changes you're making.

Don't forget to add an entry to the CHANGELOG if necessary (new features, breaking changes, relevant internal improvements).


🔄 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/418 **Author:** [@ramsayleung](https://github.com/ramsayleung) **Created:** 5/27/2023 **Status:** ✅ Merged **Merged:** 6/18/2023 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `ramsay/add_token_callback_support` --- ### 📝 Commits (10+) - [`6de9fb3`](https://github.com/ramsayleung/rspotify/commit/6de9fb3971498f1c18ab89c0435dd2a192867ee4) Add token fetch callback support - [`9eb5336`](https://github.com/ramsayleung/rspotify/commit/9eb5336a88401bf92e88ee3c71d3e6df25781fbf) Add token callback function support for AuthCodeSpotify - [`a2347de`](https://github.com/ramsayleung/rspotify/commit/a2347de12b31bd5659627a2d1012b7adb5071209) Add token callback function for AuthCodePkceSpotify - [`9babacb`](https://github.com/ramsayleung/rspotify/commit/9babacbd998739226c0b030131373800f7a50434) Add token callback support for ClientCredSpotify - [`50dc9bf`](https://github.com/ramsayleung/rspotify/commit/50dc9bfb58893399974a6e5f257557d9b46c9355) Add example to test - [`13b4b13`](https://github.com/ramsayleung/rspotify/commit/13b4b1323de7e85ecc5075b5f6a84ab672864345) Update CHANGELOG - [`365b74d`](https://github.com/ramsayleung/rspotify/commit/365b74d9c38c71ef440ac52685701e7141826a27) cargo fmt code - [`d0ba817`](https://github.com/ramsayleung/rspotify/commit/d0ba817a721992a5e4ca0fc5fccd470c5d5fa96e) fix clippy error - [`8c71294`](https://github.com/ramsayleung/rspotify/commit/8c712947d3f00293d9c324546f02b557ad08e18e) Update gitignore - [`f8ffc61`](https://github.com/ramsayleung/rspotify/commit/f8ffc61596508d2c729aa0db46c897b0c18cc6b0) Change the function signature of callback function ### 📊 Changes **9 files changed** (+158 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -1) 📝 `CHANGELOG.md` (+1 -0) 📝 `Cargo.toml` (+5 -0) 📝 `clippy.toml` (+1 -1) ➕ `examples/with_token_callback_fn.rs` (+100 -0) 📝 `src/auth_code.rs` (+10 -0) 📝 `src/auth_code_pkce.rs` (+10 -0) 📝 `src/client_creds.rs` (+5 -0) 📝 `src/lib.rs` (+25 -1) </details> ### 📄 Description ## Description Add a user-customized callback function support which is invoked whenever client succeeds to request or refresh a token, so it provides users an opportunity to save token into file, store into database etc. ## Motivation and Context #400 ## Dependencies None ## Type of change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] This change requires a documentation update ## How has this been tested? - [x] `with_token_callback_fn.rs` ## Is this change properly documented? Please make sure you've properly documented the changes you're making. Don't forget to add an entry to the CHANGELOG if necessary (new features, breaking changes, relevant internal improvements). --- <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:45 +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#442
No description provided.