feature/fix-ci-sdk-pypi-rubygem
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | use smbcloud_auth_sdk::client_credentials::ClientCredentials; |
| 2 | use smbcloud_network::environment::Environment; |
| 3 | use wasm_bindgen::JsValue; |
| 4 | use wasm_bindgen::prelude::wasm_bindgen; |
| 5 | |
| 6 | #[wasm_bindgen] |
| 7 | pub fn build_apple_authorization_request_with_client( |
| 8 | env: Environment, |
| 9 | app_id: String, |
| 10 | app_secret: String, |
| 11 | redirect_uri: String, |
| 12 | state: Option<String>, |
| 13 | ) -> Result<JsValue, JsValue> { |
| 14 | let client = ClientCredentials { |
| 15 | app_id: &app_id, |
| 16 | app_secret: &app_secret, |
| 17 | }; |
| 18 | |
| 19 | match smbcloud_auth_sdk::apple::build_authorization_request_with_client( |
| 20 | env, |
| 21 | client, |
| 22 | redirect_uri, |
| 23 | state, |
| 24 | ) { |
| 25 | Ok(response) => Ok(serde_wasm_bindgen::to_value(&response)?), |
| 26 | Err(error) => Err(serde_wasm_bindgen::to_value(&error)?), |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | #[wasm_bindgen] |
| 31 | pub fn parse_apple_callback_url( |
| 32 | callback_url: String, |
| 33 | expected_state: Option<String>, |
| 34 | ) -> Result<JsValue, JsValue> { |
| 35 | match smbcloud_auth_sdk::apple::parse_callback_url(&callback_url, expected_state.as_deref()) { |
| 36 | Ok(response) => Ok(serde_wasm_bindgen::to_value(&response)?), |
| 37 | Err(error) => Err(serde_wasm_bindgen::to_value(&error)?), |
| 38 | } |
| 39 | } |