Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional parameters for forceRefresh in iOS #801

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/NativeBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public class NativeBridge: NSObject {

@objc public func getCredentials(scope: String?, minTTL: Int, parameters: [String: Any], forceRefresh: Bool, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
if(forceRefresh) {
credentialsManager.renew { result in
credentialsManager.renew(parameters: parameters) { result in
switch result {
case .success(let credentials):
resolve(credentials.asDictionary())
Expand Down
2 changes: 1 addition & 1 deletion src/credentials-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CredentialsManager {
* @param scope The scope to request for the access token. If null is passed, the previous scope will be kept.
* @param minTtl The minimum time in seconds that the access token should last before expiration.
* @param parameters Additional parameters to send in the request to refresh expired credentials.
* @param forceRefresh Whether to force refresh the credentials. It will work only if the refresh token already exists. For iOS, doing forceRefresh will not send the scope and addtional parameters. Since scope change already does force refresh, it is better to avoid force refresh if the scope is being changed.
* @param forceRefresh Whether to force refresh the credentials. It will work only if the refresh token already exists. For iOS, doing forceRefresh will not send the scope. Since scope change already does force refresh, it is better to avoid force refresh if the scope is being changed.
* @returns A populated instance of {@link Credentials}.
*/
async getCredentials(
Expand Down