Skip to content

Commit 22db79b

Browse files
authored
chore: kickoff release
2 parents 9862d82 + 4ab4c99 commit 22db79b

File tree

5 files changed

+7
-527
lines changed

5 files changed

+7
-527
lines changed

AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/RefreshAuthorizationSession/UserPool/RefreshHostedUITokens.swift

Lines changed: 0 additions & 139 deletions
This file was deleted.

AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/Resolvers/RefreshSession/RefreshSessionState+Resolver.swift

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,19 @@ extension RefreshSessionState {
2323
case .notStarted:
2424

2525
if case .refreshCognitoUserPool(let signedInData) = event.isRefreshSessionEvent {
26-
if case .hostedUI = signedInData.signInMethod {
27-
let action = RefreshHostedUITokens(existingSignedIndata: signedInData)
28-
return .init(newState: .refreshingUserPoolToken(signedInData),
29-
actions: [action])
30-
} else {
31-
let action = RefreshUserPoolTokens(existingSignedIndata: signedInData)
32-
return .init(newState: .refreshingUserPoolToken(signedInData),
33-
actions: [action])
34-
}
26+
let action = RefreshUserPoolTokens(existingSignedIndata: signedInData)
27+
return .init(newState: .refreshingUserPoolToken(signedInData),
28+
actions: [action])
3529
}
3630

3731
if case .refreshCognitoUserPoolWithIdentityId(
3832
let signedInData,
3933
let identityID) = event.isRefreshSessionEvent {
4034

41-
if case .hostedUI = signedInData.signInMethod {
42-
let action = RefreshHostedUITokens(existingSignedIndata: signedInData)
43-
return .init(
44-
newState: .refreshingUserPoolTokenWithIdentity(signedInData,
45-
identityID),
46-
actions: [action])
47-
} else {
48-
let action = RefreshUserPoolTokens(existingSignedIndata: signedInData)
49-
return .init(newState:
50-
.refreshingUserPoolTokenWithIdentity(signedInData, identityID),
51-
actions: [action])
52-
}
35+
let action = RefreshUserPoolTokens(existingSignedIndata: signedInData)
36+
return .init(newState:
37+
.refreshingUserPoolTokenWithIdentity(signedInData, identityID),
38+
actions: [action])
5339

5440
}
5541
if case .refreshUnAuthAWSCredentials(let identityID) = event.isRefreshSessionEvent {

AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Support/HostedUI/HostedUIRequestHelper.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -120,36 +120,6 @@ struct HostedUIRequestHelper {
120120
return urlRequest
121121
}
122122

123-
static func createRefreshTokenRequest(
124-
refreshToken: String,
125-
configuration: HostedUIConfigurationData) throws -> URLRequest {
126-
127-
var components = URLComponents()
128-
components.scheme = "https"
129-
components.path = "/oauth2/token"
130-
components.host = configuration.oauth.domain
131-
132-
guard let url = components.url else {
133-
throw HostedUIError.tokenURI
134-
}
135-
136-
var queryComponents = URLComponents()
137-
queryComponents.queryItems = [
138-
.init(name: "grant_type", value: "refresh_token"),
139-
.init(name: "refresh_token", value: refreshToken),
140-
.init(name: "client_id", value: configuration.clientId)]
141-
142-
guard let body = queryComponents.query else {
143-
throw HostedUIError.tokenURI
144-
}
145-
146-
var urlRequest = URLRequest(url: url)
147-
urlRequest.httpMethod = "POST"
148-
urlRequest.httpBody = Data(body.utf8)
149-
urlRequest.addHeaders(using: configuration)
150-
return urlRequest
151-
}
152-
153123
static func urlSafeBase64(_ content: String) -> String {
154124
return content.replacingOccurrences(of: "/", with: "_")
155125
.replacingOccurrences(of: "+", with: "-")

0 commit comments

Comments
 (0)