1
0
Fork 0
mirror of synced 2024-06-11 15:24:45 +12:00

Fixed signup bug

This commit is contained in:
eldadfux 2019-09-27 00:34:32 +03:00
parent 4d4b2d1447
commit ddf4945232
7 changed files with 48 additions and 32 deletions

View file

@ -22,6 +22,7 @@ use Utopia\Locale\Locale;
data-failure-param-alert-text="Registration Failed. Please try again later"
data-failure-param-alert-classname="error">
<input name="confirmation" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/console">
<input name="success" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/console">
<input name="failure" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signup?failure=1">

View file

@ -26,8 +26,8 @@ services:
- _APP_DB_HOST=mariadb
- _APP_DB_PORT=3306
- _APP_DB_SCHEMA=appwrite
- _APP_DB_USER=root
- _APP_DB_PASS=password
- _APP_DB_USER=user1
- _APP_DB_PASS=pass1
- _APP_INFLUXDB_HOST=influxdb
- _APP_INFLUXDB_PORT=8086
- _APP_STATSD_HOST=telegraf
@ -38,8 +38,11 @@ services:
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=appwrite
- MYSQL_USER=user1
- MYSQL_PASSWORD=pass1
volumes:
- ./storage/db:/var/lib/mysql:rw
- ./storage/db2:/var/lib/mysql:rw
ports:
- 3306:3306/tcp

12
package-lock.json generated
View file

@ -834,9 +834,9 @@
}
},
"appwrite": {
"version": "1.0.19",
"resolved": "https://registry.npmjs.org/appwrite/-/appwrite-1.0.19.tgz",
"integrity": "sha512-SP9VNSrrVZi0B9kkdQLpoEy6hAoAanXtc9pk5TwBqEZf6OIs0BRRTK64eethyvzSrklceeBxY8FwEb+lYBNhuw==",
"version": "1.0.21",
"resolved": "https://registry.npmjs.org/appwrite/-/appwrite-1.0.21.tgz",
"integrity": "sha512-NfNG9JQkOQypanMKOGzPzHVTZP1MTDipbTkRveIfmNd0W25OAqpE1up9f7KHaAi8yha1uyqkYW6l9QgjECZMEw==",
"dev": true
},
"archy": {
@ -3688,9 +3688,9 @@
}
},
"handlebars": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
"integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.1.tgz",
"integrity": "sha512-c0HoNHzDiHpBt4Kqe99N8tdLPKAnGCQ73gYMPWtAYM4PwGnf7xl8PBUHJqh9ijlzt2uQKaSRxbXRt+rZ7M2/kA==",
"dev": true,
"requires": {
"neo-async": "^2.6.0",

View file

@ -4,7 +4,7 @@
"license": "BSD-3-Clause",
"repository": "public",
"devDependencies": {
"appwrite": "^1.0.19",
"appwrite": "^1.0.21",
"gulp": "^4.0.0",
"gulp-clean-css": "^4.0.0",
"gulp-concat": "2.5.2",

View file

@ -5,7 +5,7 @@
{http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this;};let setMode=function(value)
{http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this;};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&amp;|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href;};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param));}}
else{str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]));}}
return str.join("&");};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()};};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value});};addGlobalHeader('x-sdk-version','appwrite:javascript:v1.0.19');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
return str.join("&");};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()};};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value});};addGlobalHeader('x-sdk-version','appwrite:javascript:1.0.21');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
if(typeof path!=='string'){throw new Error('var path must be of type string');}
if(typeof headers!=='object'){throw new Error('var headers must be of type object');}
for(i=0;i<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value);}
@ -23,26 +23,30 @@ let path='/account/email';return http.patch(path,{'content-type':'application/js
let path='/account/name';return http.patch(path,{'content-type':'application/json'},{'name':name});},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');}
if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"');}
let path='/account/password';return http.patch(path,{'content-type':'application/json'},{'password':password,'old-password':oldPassword});},getPrefs:function(){let path='/account/prefs';return http.get(path,{'content-type':'application/json'},{});},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs});},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{});},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{});}};let auth={login:function(email,password,success='',failure=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs});},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{});},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{});}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"');}
if(password===undefined){throw new Error('Missing required parameter: "password"');}
if(success===undefined){throw new Error('Missing required parameter: "success"');}
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
let path='/auth/login';return iframe('post',path,{project:config.project,'email':email,'password':password,'success':success,'failure':failure});},logout:function(){let path='/auth/logout';return http.delete(path,{'content-type':'application/json'},{});},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"');}
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{});},recovery:function(email,redirect){if(email===undefined){throw new Error('Missing required parameter: "email"');}
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{});},oauthCallback:function(projectId,provider,code,state=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
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"');}
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,name='',success='',failure=''){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"');}
let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'name':name,'redirect':redirect,'success':success,'failure':failure});},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"');}
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,'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});},oauthCallback:function(projectId,provider,code,state=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
if(code===undefined){throw new Error('Missing required parameter: "code"');}
let path='/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='/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure});}};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/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='/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"');}

View file

@ -5,7 +5,7 @@
{http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this;};let setMode=function(value)
{http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this;};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&amp;|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href;};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param));}}
else{str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]));}}
return str.join("&");};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()};};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value});};addGlobalHeader('x-sdk-version','appwrite:javascript:v1.0.19');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
return str.join("&");};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()};};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value});};addGlobalHeader('x-sdk-version','appwrite:javascript:1.0.21');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
if(typeof path!=='string'){throw new Error('var path must be of type string');}
if(typeof headers!=='object'){throw new Error('var headers must be of type object');}
for(i=0;i<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value);}
@ -23,26 +23,30 @@ let path='/account/email';return http.patch(path,{'content-type':'application/js
let path='/account/name';return http.patch(path,{'content-type':'application/json'},{'name':name});},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');}
if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"');}
let path='/account/password';return http.patch(path,{'content-type':'application/json'},{'password':password,'old-password':oldPassword});},getPrefs:function(){let path='/account/prefs';return http.get(path,{'content-type':'application/json'},{});},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs});},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{});},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{});}};let auth={login:function(email,password,success='',failure=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs});},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{});},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{});}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"');}
if(password===undefined){throw new Error('Missing required parameter: "password"');}
if(success===undefined){throw new Error('Missing required parameter: "success"');}
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
let path='/auth/login';return iframe('post',path,{project:config.project,'email':email,'password':password,'success':success,'failure':failure});},logout:function(){let path='/auth/logout';return http.delete(path,{'content-type':'application/json'},{});},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"');}
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{});},recovery:function(email,redirect){if(email===undefined){throw new Error('Missing required parameter: "email"');}
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{});},oauthCallback:function(projectId,provider,code,state=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
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"');}
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,name='',success='',failure=''){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"');}
let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'name':name,'redirect':redirect,'success':success,'failure':failure});},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"');}
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,'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});},oauthCallback:function(projectId,provider,code,state=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
if(code===undefined){throw new Error('Missing required parameter: "code"');}
let path='/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='/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure});}};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/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='/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"');}

4
storage/db2/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore