mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Support redirect responses from API calls
Several scratchr2 views do a thing and then redirect (project, studio creation, the student password reset middleware). This allows the client to redirect to that response. Fixes GH-238. Requires LLK/scratchr2@bf451a95ea
This commit is contained in:
parent
fafff50401
commit
815c4b3f57
1 changed files with 1 additions and 0 deletions
|
@ -34,6 +34,7 @@ var Api = {
|
|||
}
|
||||
xhr(opts, function (err, res, body) {
|
||||
if (err) log.error(err);
|
||||
if (body && body[0] && 'redirect' in body[0]) window.location = body[0].redirect;
|
||||
callback(err, body);
|
||||
});
|
||||
}.bind(this);
|
||||
|
|
Loading…
Reference in a new issue