Skip to content

Commit 0250909

Browse files
committed
redirect to flexible provider
1 parent d492c63 commit 0250909

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Sources/LocalAuthentication/Routing/jsonroutes/JSONHandler.oauthRedirecter.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ extension LocalAuthJSONHandlers {
1919
for param in request.params() {
2020
str.append("\(param.0)=\(param.1)")
2121
}
22+
23+
let provider = request.urlVariables["provider"] ?? ""
24+
25+
26+
// print("REDIRECTING TO: \(LocalAuthConfig.OAuthAppNameScheme)/\(provider)?\(str.joined(separator: "&"))")
27+
// print("REDIRECTING TO: oauth-swift://oauth-callback/facebook?\(str.joined(separator: "&"))")
2228
response.status = .movedPermanently
23-
response.setHeader(.location, value: "\(LocalAuthConfig.OAuthAppNameScheme)?\(str.joined(separator: "&"))")
29+
// response.setHeader(.location, value: "oauth-swift://oauth-callback/facebook?\(str.joined(separator: "&"))")
30+
response.setHeader(.location, value: "\(LocalAuthConfig.OAuthAppNameScheme)/\(provider)?\(str.joined(separator: "&"))")
2431
response.completed()
2532
}
2633
}

0 commit comments

Comments
 (0)