From 8943ba96425126831e3a9920bc8ea849f55ca155 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sat, 21 Sep 2019 12:36:44 +0300 Subject: [PATCH] Updated SDKs --- app/sdks/dart/lib/services/auth.dart | 34 +++++------ app/sdks/js/docs/examples/auth/register.md | 2 +- .../js/docs/examples/projects/create-task.md | 2 +- .../js/docs/examples/projects/update-task.md | 2 +- app/sdks/js/src/sdk.js | 60 ++++++++----------- app/sdks/js/src/sdk.min.js | 18 +++--- app/sdks/node/docs/examples/auth/register.md | 2 +- .../docs/examples/projects/create-task.md | 2 +- .../docs/examples/projects/create-webhook.md | 2 +- app/sdks/node/lib/services/auth.js | 40 ++++++------- app/sdks/php/docs/auth.md | 12 ++-- app/sdks/php/docs/examples/auth/register.md | 2 +- .../php/docs/examples/projects/create-task.md | 2 +- .../php/docs/examples/projects/update-task.md | 2 +- app/sdks/php/src/Appwrite/Services/Auth.php | 40 ++++++------- app/sdks/python/appwrite/services/auth.py | 12 ++-- app/sdks/ruby/lib/appwrite/services/auth.rb | 12 ++-- app/tasks/sdks.php | 12 ++-- 18 files changed, 124 insertions(+), 134 deletions(-) diff --git a/app/sdks/dart/lib/services/auth.dart b/app/sdks/dart/lib/services/auth.dart index d476e4333..3fad23049 100644 --- a/app/sdks/dart/lib/services/auth.dart +++ b/app/sdks/dart/lib/services/auth.dart @@ -15,11 +15,11 @@ class Auth extends Service { /// the only valid redirect URL's are the once from domains you have set when /// added your platforms in the console interface. /// - /// When not using the success or failure redirect arguments this endpoint will - /// result with a 200 status code and the user account object on success and - /// with 401 status error on failure. This behavior was applied to help the web - /// clients deal with browsers who don't allow to set 3rd party HTTP cookies - /// needed for saving the account session token. + /// When accessing this route using Javascript from the browser, success and + /// failure parameter URLs are required. Appwrite server will respond with a + /// 301 redirect status code and will set the user session cookie. This + /// behavior is enforced because modern browsers are limiting 3rd party cookies + /// in XHR of fetch request to protect user privacy. Future login({email, password, success, failure}) async { String path = '/auth/login'; @@ -80,12 +80,12 @@ class Auth extends Service { /// values attached to the URL query string. Use the query string params to /// submit a request to the /auth/password/reset endpoint to complete the /// process. - Future recovery({email, redirect}) async { + Future recovery({email, confirmation}) async { String path = '/auth/recovery'; Map params = { 'email': email, - 'redirect': redirect, + 'confirmation': confirmation, }; return await this.client.call('post', path: path, params: params); @@ -117,7 +117,7 @@ class Auth extends Service { /// /// If registration completes successfully user will be sent with a /// confirmation email in order to confirm he is the owner of the account email - /// address. Use the redirect parameter to redirect the user from the + /// address. Use the confirmation parameter to redirect the user from the /// confirmation email back to your app. When the user is redirected, use the /// /auth/confirm endpoint to complete the account confirmation. /// @@ -126,18 +126,18 @@ class Auth extends Service { /// the only valid redirect URL's are the once from domains you have set when /// added your platforms in the console interface. /// - /// When not using the success or failure redirect arguments this endpoint will - /// result with a 200 status code and the user account object on success and - /// with 401 status error on failure. This behavior was applied to help the web - /// clients deal with browsers who don't allow to set 3rd party HTTP cookies - /// needed for saving the account session token. - Future register({email, password, redirect, success, failure, name = null}) async { + /// When accessing this route using Javascript from the browser, success and + /// failure parameter URLs are required. Appwrite server will respond with a + /// 301 redirect status code and will set the user session cookie. This + /// behavior is enforced because modern browsers are limiting 3rd party cookies + /// in XHR of fetch request to protect user privacy. + Future register({email, password, confirmation, success = null, failure = null, name = null}) async { String path = '/auth/register'; Map params = { 'email': email, 'password': password, - 'redirect': redirect, + 'confirmation': confirmation, 'success': success, 'failure': failure, 'name': name, @@ -167,11 +167,11 @@ class Auth extends Service { /// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) /// the only valid redirect URL's are the once from domains you have set when /// added your platforms in the console interface. - Future confirmResend({redirect}) async { + Future confirmResend({confirmation}) async { String path = '/auth/register/confirm/resend'; Map params = { - 'redirect': redirect, + 'confirmation': confirmation, }; return await this.client.call('post', path: path, params: params); diff --git a/app/sdks/js/docs/examples/auth/register.md b/app/sdks/js/docs/examples/auth/register.md index 2d8e83831..2367e95af 100644 --- a/app/sdks/js/docs/examples/auth/register.md +++ b/app/sdks/js/docs/examples/auth/register.md @@ -4,7 +4,7 @@ sdk setProject('') ; -let promise = sdk.auth.register('email@example.com', 'password', 'https://example.com', 'https://example.com', 'https://example.com'); +let promise = sdk.auth.register('email@example.com', 'password', 'https://example.com'); promise.then(function (response) { console.log(response); diff --git a/app/sdks/js/docs/examples/projects/create-task.md b/app/sdks/js/docs/examples/projects/create-task.md index a330566ab..5e50e25bc 100644 --- a/app/sdks/js/docs/examples/projects/create-task.md +++ b/app/sdks/js/docs/examples/projects/create-task.md @@ -4,7 +4,7 @@ sdk setProject('') ; -let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); +let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); promise.then(function (response) { console.log(response); diff --git a/app/sdks/js/docs/examples/projects/update-task.md b/app/sdks/js/docs/examples/projects/update-task.md index 267229e00..c81a0a278 100644 --- a/app/sdks/js/docs/examples/projects/update-task.md +++ b/app/sdks/js/docs/examples/projects/update-task.md @@ -4,7 +4,7 @@ sdk setProject('') ; -let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); +let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); promise.then(function (response) { console.log(response); diff --git a/app/sdks/js/src/sdk.js b/app/sdks/js/src/sdk.js index 4d0e01745..10ef5bcc8 100644 --- a/app/sdks/js/src/sdk.js +++ b/app/sdks/js/src/sdk.js @@ -500,11 +500,11 @@ * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * When not using the success or failure redirect arguments this endpoint will - * result with a 200 status code and the user account object on success and - * with 401 status error on failure. This behavior was applied to help the web - * clients deal with browsers who don't allow to set 3rd party HTTP cookies - * needed for saving the account session token. + * When accessing this route using Javascript from the browser, success and + * failure parameter URLs are required. Appwrite server will respond with a + * 301 redirect status code and will set the user session cookie. This + * behavior is enforced because modern browsers are limiting 3rd party cookies + * in XHR of fetch request to protect user privacy. * * @param {string} email * @param {string} password @@ -648,16 +648,16 @@ * process. * * @param {string} email - * @param {string} redirect + * @param {string} confirmation * @throws {Error} * @return {Promise} */ - recovery: function(email, redirect) { + recovery: function(email, confirmation) { if(email === undefined) { throw new Error('Missing required parameter: "email"'); } - if(redirect === undefined) { - throw new Error('Missing required parameter: "redirect"'); + if(confirmation === undefined) { + throw new Error('Missing required parameter: "confirmation"'); } let path = '/auth/recovery'; @@ -666,7 +666,7 @@ .post(path, {'content-type': 'application/json'}, { 'email': email, - 'redirect': redirect + 'confirmation': confirmation }); }, @@ -727,7 +727,7 @@ * * If registration completes successfully user will be sent with a * confirmation email in order to confirm he is the owner of the account email - * address. Use the redirect parameter to redirect the user from the + * address. Use the confirmation parameter to redirect the user from the * confirmation email back to your app. When the user is redirected, use the * /auth/confirm endpoint to complete the account confirmation. * @@ -736,21 +736,21 @@ * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * When not using the success or failure redirect arguments this endpoint will - * result with a 200 status code and the user account object on success and - * with 401 status error on failure. This behavior was applied to help the web - * clients deal with browsers who don't allow to set 3rd party HTTP cookies - * needed for saving the account session token. + * When accessing this route using Javascript from the browser, success and + * failure parameter URLs are required. Appwrite server will respond with a + * 301 redirect status code and will set the user session cookie. This + * behavior is enforced because modern browsers are limiting 3rd party cookies + * in XHR of fetch request to protect user privacy. * * @param {string} email * @param {string} password - * @param {string} redirect + * @param {string} confirmation * @param {string} success * @param {string} failure * @param {string} name * @throws {Error} * @return {null} */ - register: function(email, password, redirect, success, failure, name = '') { + register: function(email, password, confirmation, success = '', failure = '', name = '') { if(email === undefined) { throw new Error('Missing required parameter: "email"'); } @@ -759,16 +759,8 @@ throw new Error('Missing required parameter: "password"'); } - if(redirect === undefined) { - throw new Error('Missing required parameter: "redirect"'); - } - - if(success === undefined) { - throw new Error('Missing required parameter: "success"'); - } - - if(failure === undefined) { - throw new Error('Missing required parameter: "failure"'); + if(confirmation === undefined) { + throw new Error('Missing required parameter: "confirmation"'); } let path = '/auth/register'; @@ -776,7 +768,7 @@ return iframe('post', path, {project: config.project, 'email': email, 'password': password, - 'redirect': redirect, + 'confirmation': confirmation, 'success': success, 'failure': failure, 'name': name @@ -826,12 +818,12 @@ * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * @param {string} redirect + * @param {string} confirmation * @throws {Error} * @return {Promise} */ - confirmResend: function(redirect) { - if(redirect === undefined) { - throw new Error('Missing required parameter: "redirect"'); + confirmResend: function(confirmation) { + if(confirmation === undefined) { + throw new Error('Missing required parameter: "confirmation"'); } let path = '/auth/register/confirm/resend'; @@ -839,7 +831,7 @@ return http .post(path, {'content-type': 'application/json'}, { - 'redirect': redirect + 'confirmation': confirmation }); } }; diff --git a/app/sdks/js/src/sdk.min.js b/app/sdks/js/src/sdk.min.js index a152b7e46..d57ccdcd8 100644 --- a/app/sdks/js/src/sdk.min.js +++ b/app/sdks/js/src/sdk.min.js @@ -26,21 +26,19 @@ let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.dele if(provider===undefined){throw new Error('Missing required parameter: "provider"')} if(code===undefined){throw new Error('Missing required parameter: "code"')} let path='/auth/oauth/callback/{provider}/{projectId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'code':code,'state':state})},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')} -let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure})},recovery:function(email,redirect){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} -let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'redirect':redirect})},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} +let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure})},recovery:function(email,confirmation){if(email===undefined){throw new Error('Missing required parameter: "email"')} +if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"')} +let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'confirmation':confirmation})},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} if(token===undefined){throw new Error('Missing required parameter: "token"')} if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')} if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')} -let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB})},register:function(email,password,redirect,success,failure,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} +let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB})},register:function(email,password,confirmation,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} if(password===undefined){throw new Error('Missing required parameter: "password"')} -if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} -if(success===undefined){throw new Error('Missing required parameter: "success"')} -if(failure===undefined){throw new Error('Missing required parameter: "failure"')} -let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'redirect':redirect,'success':success,'failure':failure,'name':name})},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} +if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"')} +let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'confirmation':confirmation,'success':success,'failure':failure,'name':name})},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} if(token===undefined){throw new Error('Missing required parameter: "token"')} -let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token})},confirmResend:function(redirect){if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} -let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'redirect':redirect})}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} +let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token})},confirmResend:function(confirmation){if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"')} +let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'confirmation':confirmation})}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} let path='/avatars/favicon';return http.get(path,{'content-type':'application/json'},{'url':url})},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} diff --git a/app/sdks/node/docs/examples/auth/register.md b/app/sdks/node/docs/examples/auth/register.md index 32871671a..40cc88438 100644 --- a/app/sdks/node/docs/examples/auth/register.md +++ b/app/sdks/node/docs/examples/auth/register.md @@ -10,7 +10,7 @@ client setKey('') ; -let promise = auth.register('email@example.com', 'password', 'https://example.com', 'https://example.com', 'https://example.com'); +let promise = auth.register('email@example.com', 'password', 'https://example.com'); promise.then(function (response) { console.log(response); diff --git a/app/sdks/node/docs/examples/projects/create-task.md b/app/sdks/node/docs/examples/projects/create-task.md index f1f3223bc..5a31042a6 100644 --- a/app/sdks/node/docs/examples/projects/create-task.md +++ b/app/sdks/node/docs/examples/projects/create-task.md @@ -10,7 +10,7 @@ client setKey('') ; -let promise = projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); +let promise = projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); promise.then(function (response) { console.log(response); diff --git a/app/sdks/node/docs/examples/projects/create-webhook.md b/app/sdks/node/docs/examples/projects/create-webhook.md index ef1f2ad6d..cf09e96c3 100644 --- a/app/sdks/node/docs/examples/projects/create-webhook.md +++ b/app/sdks/node/docs/examples/projects/create-webhook.md @@ -10,7 +10,7 @@ client setKey('') ; -let promise = projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0); +let promise = projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 1); promise.then(function (response) { console.log(response); diff --git a/app/sdks/node/lib/services/auth.js b/app/sdks/node/lib/services/auth.js index 464ceab6b..f6bf9dec4 100644 --- a/app/sdks/node/lib/services/auth.js +++ b/app/sdks/node/lib/services/auth.js @@ -14,11 +14,11 @@ class Auth extends Service { * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * When not using the success or failure redirect arguments this endpoint will - * result with a 200 status code and the user account object on success and - * with 401 status error on failure. This behavior was applied to help the web - * clients deal with browsers who don't allow to set 3rd party HTTP cookies - * needed for saving the account session token. + * When accessing this route using Javascript from the browser, success and + * failure parameter URLs are required. Appwrite server will respond with a + * 301 redirect status code and will set the user session cookie. This + * behavior is enforced because modern browsers are limiting 3rd party cookies + * in XHR of fetch request to protect user privacy. * * @param string email * @param string password @@ -126,17 +126,17 @@ class Auth extends Service { * process. * * @param string email - * @param string redirect + * @param string confirmation * @throws Exception * @return {} */ - async recovery(email, redirect) { + async recovery(email, confirmation) { let path = '/auth/recovery'; return await this.client.call('post', path, {'content-type': 'application/json'}, { 'email': email, - 'redirect': redirect + 'confirmation': confirmation }); } @@ -181,7 +181,7 @@ class Auth extends Service { * * If registration completes successfully user will be sent with a * confirmation email in order to confirm he is the owner of the account email - * address. Use the redirect parameter to redirect the user from the + * address. Use the confirmation parameter to redirect the user from the * confirmation email back to your app. When the user is redirected, use the * /auth/confirm endpoint to complete the account confirmation. * @@ -190,29 +190,29 @@ class Auth extends Service { * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * When not using the success or failure redirect arguments this endpoint will - * result with a 200 status code and the user account object on success and - * with 401 status error on failure. This behavior was applied to help the web - * clients deal with browsers who don't allow to set 3rd party HTTP cookies - * needed for saving the account session token. + * When accessing this route using Javascript from the browser, success and + * failure parameter URLs are required. Appwrite server will respond with a + * 301 redirect status code and will set the user session cookie. This + * behavior is enforced because modern browsers are limiting 3rd party cookies + * in XHR of fetch request to protect user privacy. * * @param string email * @param string password - * @param string redirect + * @param string confirmation * @param string success * @param string failure * @param string name * @throws Exception * @return {} */ - async register(email, password, redirect, success, failure, name = '') { + async register(email, password, confirmation, success = '', failure = '', name = '') { let path = '/auth/register'; return await this.client.call('post', path, {'content-type': 'application/json'}, { 'email': email, 'password': password, - 'redirect': redirect, + 'confirmation': confirmation, 'success': success, 'failure': failure, 'name': name @@ -254,16 +254,16 @@ class Auth extends Service { * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * @param string redirect + * @param string confirmation * @throws Exception * @return {} */ - async confirmResend(redirect) { + async confirmResend(confirmation) { let path = '/auth/register/confirm/resend'; return await this.client.call('post', path, {'content-type': 'application/json'}, { - 'redirect': redirect + 'confirmation': confirmation }); } } diff --git a/app/sdks/php/docs/auth.md b/app/sdks/php/docs/auth.md index e82d34395..d727edc32 100644 --- a/app/sdks/php/docs/auth.md +++ b/app/sdks/php/docs/auth.md @@ -10,7 +10,7 @@ POST https://appwrite.test/v1/auth/login Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. -When not using the success or failure redirect arguments this endpoint will result with a 200 status code and the user account object on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session token. ** +When accessing this route using Javascript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch request to protect user privacy. ** ### Parameters @@ -85,7 +85,7 @@ POST https://appwrite.test/v1/auth/recovery | Field Name | Type | Description | Default | | --- | --- | --- | --- | | email | string | User account email address. | | -| redirect | string | Reset page in your app to redirect user after reset token has been sent to user email. | | +| confirmation | string | Reset page URL in your app to redirect user after reset token has been sent to user email. | | ## Password Reset @@ -114,11 +114,11 @@ POST https://appwrite.test/v1/auth/register ** Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL's to redirect users back to your application after signup completes. -If registration completes successfully user will be sent with a confirmation email in order to confirm he is the owner of the account email address. Use the redirect parameter to redirect the user from the confirmation email back to your app. When the user is redirected, use the /auth/confirm endpoint to complete the account confirmation. +If registration completes successfully user will be sent with a confirmation email in order to confirm he is the owner of the account email address. Use the confirmation parameter to redirect the user from the confirmation email back to your app. When the user is redirected, use the /auth/confirm endpoint to complete the account confirmation. Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. -When not using the success or failure redirect arguments this endpoint will result with a 200 status code and the user account object on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session token. ** +When accessing this route using Javascript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch request to protect user privacy. ** ### Parameters @@ -126,7 +126,7 @@ When not using the success or failure redirect arguments this endpoint will resu | --- | --- | --- | --- | | email | string | Account email | | | password | string | User password | | -| redirect | string | Confirmation page to redirect user after confirm token has been sent to user email | | +| confirmation | string | Confirmation URL to redirect user after confirm token has been sent to user email | | | success | string | Redirect when registration succeed | | | failure | string | Redirect when registration failed | | | name | string | User name | | @@ -160,5 +160,5 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| redirect | string | Confirmation page to redirect user to your app after confirm token has been sent to user email. | | +| confirmation | string | Confirmation page to redirect user to your app after confirm token has been sent to user email. | | diff --git a/app/sdks/php/docs/examples/auth/register.md b/app/sdks/php/docs/examples/auth/register.md index becd872b1..8ecc026f4 100644 --- a/app/sdks/php/docs/examples/auth/register.md +++ b/app/sdks/php/docs/examples/auth/register.md @@ -12,4 +12,4 @@ $client $auth = new Auth($client); -$result = $auth->register('email@example.com', 'password', 'https://example.com', 'https://example.com', 'https://example.com'); \ No newline at end of file +$result = $auth->register('email@example.com', 'password', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/create-task.md b/app/sdks/php/docs/examples/projects/create-task.md index 77daf56b4..900efe40e 100644 --- a/app/sdks/php/docs/examples/projects/create-task.md +++ b/app/sdks/php/docs/examples/projects/create-task.md @@ -12,4 +12,4 @@ $client $projects = new Projects($client); -$result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); \ No newline at end of file +$result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/update-task.md b/app/sdks/php/docs/examples/projects/update-task.md index 01a229b7b..409f00486 100644 --- a/app/sdks/php/docs/examples/projects/update-task.md +++ b/app/sdks/php/docs/examples/projects/update-task.md @@ -12,4 +12,4 @@ $client $projects = new Projects($client); -$result = $projects->updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); \ No newline at end of file +$result = $projects->updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/src/Appwrite/Services/Auth.php b/app/sdks/php/src/Appwrite/Services/Auth.php index 7b7495936..1b6f01d9b 100644 --- a/app/sdks/php/src/Appwrite/Services/Auth.php +++ b/app/sdks/php/src/Appwrite/Services/Auth.php @@ -20,11 +20,11 @@ class Auth extends Service * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * When not using the success or failure redirect arguments this endpoint will - * result with a 200 status code and the user account object on success and - * with 401 status error on failure. This behavior was applied to help the web - * clients deal with browsers who don't allow to set 3rd party HTTP cookies - * needed for saving the account session token. + * When accessing this route using Javascript from the browser, success and + * failure parameter URLs are required. Appwrite server will respond with a + * 301 redirect status code and will set the user session cookie. This + * behavior is enforced because modern browsers are limiting 3rd party cookies + * in XHR of fetch request to protect user privacy. * * @param string $email * @param string $password @@ -142,17 +142,17 @@ class Auth extends Service * process. * * @param string $email - * @param string $redirect + * @param string $confirmation * @throws Exception * @return array */ - public function recovery($email, $redirect) + public function recovery($email, $confirmation) { $path = str_replace([], [], '/auth/recovery'); $params = []; $params['email'] = $email; - $params['redirect'] = $redirect; + $params['confirmation'] = $confirmation; return $this->client->call(Client::METHOD_POST, $path, [ ], $params); @@ -201,7 +201,7 @@ class Auth extends Service * * If registration completes successfully user will be sent with a * confirmation email in order to confirm he is the owner of the account email - * address. Use the redirect parameter to redirect the user from the + * address. Use the confirmation parameter to redirect the user from the * confirmation email back to your app. When the user is redirected, use the * /auth/confirm endpoint to complete the account confirmation. * @@ -210,29 +210,29 @@ class Auth extends Service * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * When not using the success or failure redirect arguments this endpoint will - * result with a 200 status code and the user account object on success and - * with 401 status error on failure. This behavior was applied to help the web - * clients deal with browsers who don't allow to set 3rd party HTTP cookies - * needed for saving the account session token. + * When accessing this route using Javascript from the browser, success and + * failure parameter URLs are required. Appwrite server will respond with a + * 301 redirect status code and will set the user session cookie. This + * behavior is enforced because modern browsers are limiting 3rd party cookies + * in XHR of fetch request to protect user privacy. * * @param string $email * @param string $password - * @param string $redirect + * @param string $confirmation * @param string $success * @param string $failure * @param string $name * @throws Exception * @return array */ - public function register($email, $password, $redirect, $success, $failure, $name = '') + public function register($email, $password, $confirmation, $success = '', $failure = '', $name = '') { $path = str_replace([], [], '/auth/register'); $params = []; $params['email'] = $email; $params['password'] = $password; - $params['redirect'] = $redirect; + $params['confirmation'] = $confirmation; $params['success'] = $success; $params['failure'] = $failure; $params['name'] = $name; @@ -278,16 +278,16 @@ class Auth extends Service * the only valid redirect URL's are the once from domains you have set when * added your platforms in the console interface. * - * @param string $redirect + * @param string $confirmation * @throws Exception * @return array */ - public function confirmResend($redirect) + public function confirmResend($confirmation) { $path = str_replace([], [], '/auth/register/confirm/resend'); $params = []; - $params['redirect'] = $redirect; + $params['confirmation'] = $confirmation; return $this->client->call(Client::METHOD_POST, $path, [ ], $params); diff --git a/app/sdks/python/appwrite/services/auth.py b/app/sdks/python/appwrite/services/auth.py index f082987d4..f36451f50 100644 --- a/app/sdks/python/appwrite/services/auth.py +++ b/app/sdks/python/appwrite/services/auth.py @@ -60,13 +60,13 @@ class Auth(Service): return self.client.call('get', path, { }, params) - def recovery(self, email, redirect): + def recovery(self, email, confirmation): """Password Recovery""" params = {} path = '/auth/recovery' params['email'] = email - params['redirect'] = redirect + params['confirmation'] = confirmation return self.client.call('post', path, { }, params) @@ -84,14 +84,14 @@ class Auth(Service): return self.client.call('put', path, { }, params) - def register(self, email, password, redirect, success, failure, name=''): + def register(self, email, password, confirmation, success='', failure='', name=''): """Register User""" params = {} path = '/auth/register' params['email'] = email params['password'] = password - params['redirect'] = redirect + params['confirmation'] = confirmation params['success'] = success params['failure'] = failure params['name'] = name @@ -110,12 +110,12 @@ class Auth(Service): return self.client.call('post', path, { }, params) - def confirm_resend(self, redirect): + def confirm_resend(self, confirmation): """Resend Confirmation""" params = {} path = '/auth/register/confirm/resend' - params['redirect'] = redirect + params['confirmation'] = confirmation return self.client.call('post', path, { }, params) diff --git a/app/sdks/ruby/lib/appwrite/services/auth.rb b/app/sdks/ruby/lib/appwrite/services/auth.rb index b8b6794c2..cdbd3d31c 100644 --- a/app/sdks/ruby/lib/appwrite/services/auth.rb +++ b/app/sdks/ruby/lib/appwrite/services/auth.rb @@ -63,12 +63,12 @@ module Appwrite }, params); end - def recovery(email:, redirect:) + def recovery(email:, confirmation:) path = '/auth/recovery' params = { 'email': email, - 'redirect': redirect + 'confirmation': confirmation } return @client.call('post', path, { @@ -89,13 +89,13 @@ module Appwrite }, params); end - def register(email:, password:, redirect:, success:, failure:, name: '') + def register(email:, password:, confirmation:, success: '', failure: '', name: '') path = '/auth/register' params = { 'email': email, 'password': password, - 'redirect': redirect, + 'confirmation': confirmation, 'success': success, 'failure': failure, 'name': name @@ -117,11 +117,11 @@ module Appwrite }, params); end - def confirm_resend(redirect:) + def confirm_resend(confirmation:) path = '/auth/register/confirm/resend' params = { - 'redirect': redirect + 'confirmation': confirmation } return @client.call('post', path, { diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index b5925c8d3..3d2bf8bde 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -36,7 +36,7 @@ $cli $clients = [ 'php' => [ - 'version' => 'v1.0.7', + 'version' => '1.0.8', 'result' => __DIR__.'/../sdks/php/', 'gitURL' => 'https://github.com/appwrite/sdk-for-php.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-php.git', @@ -46,7 +46,7 @@ $cli 'platform' => 'server', ], 'js' => [ - 'version' => 'v1.0.20', + 'version' => '1.0.21', 'result' => __DIR__.'/../sdks/js/', 'gitURL' => 'https://github.com/appwrite/sdk-for-js.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-js.git', @@ -56,7 +56,7 @@ $cli 'platform' => 'client', ], 'node' => [ - 'version' => 'v1.0.24', + 'version' => '1.0.25', 'result' => __DIR__.'/../sdks/node/', 'gitURL' => 'https://github.com/appwrite/sdk-for-node.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-node.git', @@ -66,7 +66,7 @@ $cli 'platform' => 'server', ], 'python' => [ - 'version' => 'v1.0.0', + 'version' => '1.0.0', 'result' => __DIR__.'/../sdks/python/', 'gitURL' => 'https://github.com/appwrite/sdk-for-python.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-python.git', @@ -76,7 +76,7 @@ $cli 'platform' => 'server', ], 'ruby' => [ - 'version' => 'v1.0.0', + 'version' => '1.0.1', 'result' => __DIR__.'/../sdks/ruby/', 'gitURL' => 'https://github.com/appwrite/sdk-for-ruby.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-ruby.git', @@ -86,7 +86,7 @@ $cli 'platform' => 'server', ], 'dart' => [ - 'version' => '0.0.1', + 'version' => '0.0.2', 'result' => __DIR__.'/../sdks/dart/', 'gitURL' => 'https://github.com/appwrite/sdk-for-dart', 'gitRepo' => 'git@github.com:appwrite/sdk-for-dart.git',