(arg)
| 117 | } |
| 118 | |
| 119 | export function oauthlogin (arg) { |
| 120 | if (!sourceToken.checkExistSource()) { |
| 121 | sourceToken.init() |
| 122 | } |
| 123 | |
| 124 | // Logout before login is called to purge any duplicate sessionkey cookies |
| 125 | postAPI('logout') |
| 126 | |
| 127 | const params = new URLSearchParams() |
| 128 | params.append('command', 'oauthlogin') |
| 129 | params.append('email', arg.email) |
| 130 | params.append('secretcode', arg.secretcode) |
| 131 | params.append('provider', arg.provider) |
| 132 | params.append('domain', arg.domain) |
| 133 | params.append('response', 'json') |
| 134 | return axios({ |
| 135 | url: '/', |
| 136 | method: 'post', |
| 137 | data: params, |
| 138 | headers: { |
| 139 | 'content-type': 'application/x-www-form-urlencoded' |
| 140 | } |
| 141 | }) |
| 142 | } |
no test coverage detected