Skip to content

Commit

Permalink
Support additional parameters for forceRefresh in iOS (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
poovamraj committed Nov 13, 2023
1 parent 8a05917 commit 10d095e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 10d095e

Please sign in to comment.