mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
v3: support party invitation from email
This commit is contained in:
@@ -51,7 +51,15 @@ angular.module('habitrpg')
|
|||||||
$scope.registrationInProgress = true;
|
$scope.registrationInProgress = true;
|
||||||
|
|
||||||
var url = ApiUrl.get() + "/api/v3/user/auth/local/register";
|
var url = ApiUrl.get() + "/api/v3/user/auth/local/register";
|
||||||
if($rootScope.selectedLanguage) url = url + '?lang=' + $rootScope.selectedLanguage.code;
|
if (location.search && location.search.indexOf('Invite=') !== -1) { // matches groupInvite and partyInvite
|
||||||
|
url += location.search;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($rootScope.selectedLanguage) {
|
||||||
|
var toAppend = url.indexOf('?') !== -1 ? '&' : '?';
|
||||||
|
url = url + toAppend + 'lang=' + $rootScope.selectedLanguage.code;
|
||||||
|
}
|
||||||
|
|
||||||
$http.post(url, scope.registerVals).success(function(res, status, headers, config) {
|
$http.post(url, scope.registerVals).success(function(res, status, headers, config) {
|
||||||
runAuth(res.data._id, res.data.apiToken);
|
runAuth(res.data._id, res.data.apiToken);
|
||||||
}).error(errorAlert);
|
}).error(errorAlert);
|
||||||
|
|||||||
@@ -568,7 +568,7 @@ async function _inviteByEmail (invite, group, inviter, req, res) {
|
|||||||
inviter: inviter._id,
|
inviter: inviter._id,
|
||||||
sentAt: Date.now(), // so we can let it expire
|
sentAt: Date.now(), // so we can let it expire
|
||||||
});
|
});
|
||||||
let link = `?groupInvite=${encrypt(groupQueryString)}`;
|
let link = `/static/front?groupInvite=${encrypt(groupQueryString)}`;
|
||||||
|
|
||||||
let variables = [
|
let variables = [
|
||||||
{name: 'LINK', content: link},
|
{name: 'LINK', content: link},
|
||||||
|
|||||||
Reference in New Issue
Block a user