Skip to content
Merged
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
8 changes: 4 additions & 4 deletions Sources/OAuthenticator/Services/Bluesky.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ public enum Bluesky {
throw AuthenticatorError.stateTokenMismatch(state, params.stateToken)
}

if iss != server.issuer {
throw AuthenticatorError.issuingServerMismatch(iss, server.issuer)
}

// and use them (plus just a little more) to construct the token request
guard let tokenURL = URL(string: server.tokenEndpoint) else {
throw AuthenticatorError.missingTokenURL
Expand Down Expand Up @@ -169,10 +173,6 @@ public enum Bluesky {
throw AuthenticatorError.dpopTokenExpected(tokenResponse.token_type)
}

if iss != server.issuer {
throw AuthenticatorError.issuingServerMismatch(iss, server.issuer)
}

if try await validator(tokenResponse, server.issuer) == false {
throw AuthenticatorError.tokenInvalid
}
Expand Down
Loading