mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-08-17 13:57:11 +02:00
global: make ready for self hosting
This exposes a few more env vars for configuration & bypasses the Subscription backend so each user is Pro by default. This is required because there won't be any mechanism for the user to upgrade. We'll also have to disable a few things on the client side to avoid confusion.
This commit is contained in:
@@ -17,6 +17,7 @@ You should have received a copy of the Affero GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
@@ -30,6 +31,7 @@ using Streetwriters.Common.Models;
|
||||
using Streetwriters.Identity.Enums;
|
||||
using Streetwriters.Identity.Interfaces;
|
||||
using Streetwriters.Identity.Models;
|
||||
using Streetwriters.Identity.Services;
|
||||
|
||||
namespace Streetwriters.Identity.Controllers
|
||||
{
|
||||
@@ -97,7 +99,8 @@ namespace Streetwriters.Identity.Controllers
|
||||
var user = await UserManager.FindByEmailAsync(form.Email);
|
||||
|
||||
await UserManager.AddToRoleAsync(user, client.Id);
|
||||
// await UserManager.AddClaimAsync(user, new Claim("verified", "false"));
|
||||
if (Constants.IS_SELF_HOSTED)
|
||||
await UserManager.AddClaimAsync(user, UserService.SubscriptionTypeToClaim(client.Id, Common.Enums.SubscriptionType.PREMIUM));
|
||||
|
||||
var code = await UserManager.GenerateEmailConfirmationTokenAsync(user);
|
||||
var callbackUrl = Url.TokenLink(user.Id.ToString(), code, client.Id, TokenType.CONFRIM_EMAIL, Request.Scheme);
|
||||
|
||||
Reference in New Issue
Block a user