Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 28.1.0

* Added: optional `state` parameter on `createOAuth2Token`, returned unchanged on the success and failure URLs

## 28.0.0

* Stable release of the dedicated database APIs: `mysql`, `postgresql`, `mongo`, `documentsDB`, and `vectorsDB` services, previously released as release candidates
Expand Down
2 changes: 1 addition & 1 deletion appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'appwrite'
spec.version = '28.0.0'
spec.version = '28.1.0'
spec.license = 'BSD-3-Clause'
spec.summary = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API'
spec.author = 'Appwrite Team'
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ result = account.create_o_auth2_token(
provider: OAuthProvider::AMAZON,
success: 'https://example.com', # optional
failure: 'https://example.com', # optional
scopes: [] # optional
scopes: [], # optional
state: '<STATE>' # optional
)
```
2 changes: 1 addition & 1 deletion lib/appwrite/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize
'x-sdk-name' => 'Ruby',
'x-sdk-platform' => 'server',
'x-sdk-language' => 'ruby',
'x-sdk-version' => '28.0.0',
'x-sdk-version' => '28.1.0',
'X-Appwrite-Response-Format' => '2.0.0'
}
@endpoint = 'https://cloud.appwrite.io/v1'
Expand Down
5 changes: 4 additions & 1 deletion lib/appwrite/services/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1554,13 +1554,15 @@ def create_magic_url_token(
# @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project&#039;s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
# @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project&#039;s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
# @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
# @param [String] state An opaque value your app generates and keeps, for example in a cookie. It is returned unchanged as the `state` query parameter on the success and failure URLs, so your app can check that the sign-in it receives is one it started. Printable ASCII only (RFC 6749 Appendix A.5). Max length: 256 chars.
#
# @return []
def create_o_auth2_token(
provider:,
success: nil,
failure: nil,
scopes: nil
scopes: nil,
state: nil
)
api_path = '/account/tokens/oauth2/{provider}'
.gsub('{provider}', provider)
Expand All @@ -1573,6 +1575,7 @@ def create_o_auth2_token(
success: success,
failure: failure,
scopes: scopes,
state: state,
}

api_headers = {
Expand Down
Loading