| 2 | |
| 3 | // Forms |
| 4 | const UserSignIn = ({ context: { _t } }) => ({ |
| 5 | type: 'object', |
| 6 | name: 'user_sign_in', |
| 7 | resource: 'auth/login', |
| 8 | title: _t('Sign In'), |
| 9 | properties: { |
| 10 | username: { |
| 11 | title: _t('Username'), |
| 12 | type: 'string' |
| 13 | }, |
| 14 | password: { |
| 15 | title: _t('Password'), |
| 16 | type: 'string' |
| 17 | }, |
| 18 | ...(_c('auth.login.captcha')?{ |
| 19 | code: { |
| 20 | title: _t('Captcha Code'), |
| 21 | type: 'string', |
| 22 | fieldType: 'captcha' |
| 23 | } |
| 24 | }:{}) |
| 25 | }, |
| 26 | required: [ 'username', 'password', ...(_c('auth.login.captcha')?[ 'code' ]:[]) ], |
| 27 | form: [ |
| 28 | 'username', |
| 29 | { key: 'password', attrs: { type: 'password' } }, |
| 30 | ...(_c('auth.login.captcha')?[ { |
| 31 | key: 'code', captcha_url: '/' + _c('auth.login.captcha') |
| 32 | } ]:[]) |
| 33 | ] |
| 34 | }) |
| 35 | |
| 36 | const UserSignOut = ({ context: { _t } }) => ({ |
| 37 | type: 'object', |