mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Added support for non-ssl networking
This commit is contained in:
+9
-9
@@ -42,7 +42,7 @@ $clients = array_map(function($node) {
|
||||
}));
|
||||
|
||||
$utopia->init(function() use ($utopia, $request, $response, $register, &$user, $project, $roles, $webhook, $audit, $usage, $domain, $clients) {
|
||||
|
||||
|
||||
$route = $utopia->match($request);
|
||||
|
||||
/**
|
||||
@@ -51,8 +51,8 @@ $utopia->init(function() use ($utopia, $request, $response, $register, &$user, $
|
||||
$https = $request->getServer('HTTP_X_FORWARDED_PROTO', $request->getServer('HTTPS', ''));
|
||||
|
||||
if (empty($https) || 'off' == $https) {
|
||||
$response->redirect('https://' . $request->getServer('HTTP_HOST', '') . $request->getServer('REQUEST_URI'));
|
||||
exit(0);
|
||||
//$response->redirect('https://' . $request->getServer('HTTP_HOST', '') . $request->getServer('REQUEST_URI'));
|
||||
//exit(0);
|
||||
}
|
||||
|
||||
$referrer = $request->getServer('HTTP_REFERER', '');
|
||||
@@ -70,11 +70,11 @@ $utopia->init(function() use ($utopia, $request, $response, $register, &$user, $
|
||||
$response
|
||||
->addHeader('Server', 'Appwrite')
|
||||
->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url=' . urlencode($request->getServer('REQUEST_URI')))
|
||||
->addHeader('Strict-Transport-Security', 'max-age=16070400')
|
||||
//->addHeader('Strict-Transport-Security', 'max-age=16070400')
|
||||
//->addHeader('X-Frame-Options', ($refDomain == 'http://localhost') ? 'SAMEORIGIN' : 'ALLOW-FROM ' . $refDomain)
|
||||
->addHeader('X-Content-Type-Options', 'nosniff')
|
||||
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
|
||||
->addHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Ajax, Origin, Content-Type, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version')
|
||||
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version')
|
||||
->addHeader('Access-Control-Allow-Origin', $refDomain)
|
||||
->addHeader('Access-Control-Allow-Credentials', 'true')
|
||||
;
|
||||
@@ -83,7 +83,7 @@ $utopia->init(function() use ($utopia, $request, $response, $register, &$user, $
|
||||
* Validate Client Domain - Check to avoid CSRF attack
|
||||
* Adding appwrite api domains to allow XDOMAIN communication
|
||||
*/
|
||||
$hostValidator = new Host(array_merge($clients, ['http://localhost', 'https://localhost', 'https://appwrite.test', 'https://appwrite.io']));
|
||||
$hostValidator = new Host($clients);
|
||||
|
||||
if(!$hostValidator->isValid($request->getServer('HTTP_ORIGIN', $request->getServer('HTTP_REFERER', '')))
|
||||
&& in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE])
|
||||
@@ -249,7 +249,7 @@ $utopia->options(function() use ($request, $response, $domain, $project) {
|
||||
|
||||
$response
|
||||
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
|
||||
->addHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Ajax, Origin, Content-Type, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version')
|
||||
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version')
|
||||
->addHeader('Access-Control-Allow-Origin', $origin)
|
||||
->addHeader('Access-Control-Allow-Credentials', 'true')
|
||||
->send();
|
||||
@@ -462,7 +462,7 @@ $utopia->get('/v1/open-api-2.json')
|
||||
->label('docs', false)
|
||||
->param('extensions', 0 , function () {return new Range(0, 1);}, 'Show extra data.', true)
|
||||
->action(
|
||||
function($extensions) use ($response, $utopia, $domain, $version, $services, $consoleDB) {
|
||||
function($extensions) use ($response, $request, $utopia, $domain, $version, $services) {
|
||||
|
||||
function fromCamelCase($input) {
|
||||
preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);
|
||||
@@ -613,7 +613,7 @@ $utopia->get('/v1/open-api-2.json')
|
||||
),
|
||||
'externalDocs' => [
|
||||
'description' => 'Full API docs, specs and tutorials',
|
||||
'url' => APP_PROTOCOL . '://' . $domain . '/docs'
|
||||
'url' => $request->getServer('REQUEST_SCHEME', 'https') . '://' . $domain . '/docs'
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ $utopia->delete('/v1/account')
|
||||
->label('sdk.method', 'delete')
|
||||
->label('sdk.description', 'Delete currently logged in user account.')
|
||||
->action(
|
||||
function() use ($response, $user, $projectDB, $audit)
|
||||
function() use ($response, $request, $user, $projectDB, $audit)
|
||||
{
|
||||
$user = $projectDB->updateDocument(array_merge($user->getArrayCopy(), [
|
||||
'status' => Auth::USER_STATUS_BLOCKED,
|
||||
@@ -367,7 +367,7 @@ $utopia->delete('/v1/account')
|
||||
;
|
||||
|
||||
$response
|
||||
->addCookie(Auth::$cookieName, '', time() - 3600, '/', COOKIE_DOMAIN, ('https' == APP_PROTOCOL), true)
|
||||
->addCookie(Auth::$cookieName, '', time() - 3600, '/', COOKIE_DOMAIN, ('https' == $request->getServer('REQUEST_SCHEME', 'https')), true)
|
||||
->json(array('result' => 'success'));
|
||||
}
|
||||
);
|
||||
@@ -167,7 +167,7 @@ $utopia->post('/v1/auth/register')
|
||||
->setParam('event', 'auth.register')
|
||||
;
|
||||
|
||||
$response->addCookie(Auth::$cookieName, Auth::encodeSession($user->getUid(), $loginSecret), $expiry, '/', COOKIE_DOMAIN, ('https' == APP_PROTOCOL), true);
|
||||
$response->addCookie(Auth::$cookieName, Auth::encodeSession($user->getUid(), $loginSecret), $expiry, '/', COOKIE_DOMAIN, ('https' == $request->getServer('REQUEST_SCHEME', 'https')), true);
|
||||
|
||||
if($success) {
|
||||
$response->redirect($success);
|
||||
@@ -369,7 +369,7 @@ $utopia->post('/v1/auth/login')
|
||||
;
|
||||
|
||||
$response
|
||||
->addCookie(Auth::$cookieName, Auth::encodeSession($profile->getUid(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == APP_PROTOCOL), true);
|
||||
->addCookie(Auth::$cookieName, Auth::encodeSession($profile->getUid(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $request->getServer('REQUEST_SCHEME', 'https')), true);
|
||||
|
||||
if($success) {
|
||||
$response->redirect($success);
|
||||
@@ -408,7 +408,7 @@ $utopia->delete('/v1/auth/logout')
|
||||
$audit->setParam('event', 'auth.logout');
|
||||
|
||||
$response
|
||||
->addCookie(Auth::$cookieName, '', time() - 3600, '/', COOKIE_DOMAIN, ('https' == APP_PROTOCOL), true)
|
||||
->addCookie(Auth::$cookieName, '', time() - 3600, '/', COOKIE_DOMAIN, ('https' == $request->getServer('REQUEST_SCHEME', 'https')), true)
|
||||
->json(array('result' => 'success'))
|
||||
;
|
||||
}
|
||||
@@ -440,7 +440,7 @@ $utopia->delete('/v1/auth/logout/:id')
|
||||
;
|
||||
|
||||
if($token->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete cookies
|
||||
$response->addCookie(Auth::$cookieName, '', time() - 3600, '/', COOKIE_DOMAIN, ('https' == APP_PROTOCOL), true);
|
||||
$response->addCookie(Auth::$cookieName, '', time() - 3600, '/', COOKIE_DOMAIN, ('https' == $request->getServer('REQUEST_SCHEME', 'https')), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -608,7 +608,7 @@ $utopia->get('/v1/oauth/:provider')
|
||||
->action(
|
||||
function($provider, $success, $failure) use ($response, $request, $project)
|
||||
{
|
||||
$callback = APP_PROTOCOL . '://' . $request->getServer('HTTP_HOST') . '/v1/oauth/callback/' . $provider . '/' . $project->getUid();
|
||||
$callback = $request->getServer('REQUEST_SCHEME', 'https') . '://' . $request->getServer('HTTP_HOST') . '/v1/oauth/callback/' . $provider . '/' . $project->getUid();
|
||||
$appId = $project->getAttribute('usersOauth' . ucfirst($provider) . 'Appid', '');
|
||||
$appSecret = $project->getAttribute('usersOauth' . ucfirst($provider) . 'Secret', '{}');
|
||||
|
||||
@@ -672,9 +672,9 @@ $utopia->get('/v1/oauth/callback/:provider/:projectId')
|
||||
->param('code', '', function () {return new Text(1024);}, 'OAuth code')
|
||||
->param('state', '', function () {return new Text(2048);}, 'Login state params', true)
|
||||
->action(
|
||||
function($projectId, $provider, $code, $state) use ($response, $domain)
|
||||
function($projectId, $provider, $code, $state) use ($response, $request, $domain)
|
||||
{
|
||||
$response->redirect(APP_PROTOCOL . '://' . $domain . '/v1/oauth/' . $provider . '/redirect?'
|
||||
$response->redirect($request->getServer('REQUEST_SCHEME', 'https') . '://' . $domain . '/v1/oauth/' . $provider . '/redirect?'
|
||||
. http_build_query(['project' => $projectId, 'code' => $code, 'state' => $state]));
|
||||
}
|
||||
);
|
||||
@@ -695,7 +695,7 @@ $utopia->get('/v1/oauth/:provider/redirect')
|
||||
->action(
|
||||
function($provider, $code, $state) use ($response, $request, $user, $projectDB, $project, $audit)
|
||||
{
|
||||
$callback = APP_PROTOCOL . '://' . $request->getServer('HTTP_HOST') . '/v1/oauth/callback/' . $provider . '/' . $project->getUid();
|
||||
$callback = $request->getServer('REQUEST_SCHEME', 'https') . '://' . $request->getServer('HTTP_HOST') . '/v1/oauth/callback/' . $provider . '/' . $project->getUid();
|
||||
$defaultState = ['success' => $project->getAttribute('url', ''), 'failure' => ''];
|
||||
$validateURL = new URL();
|
||||
|
||||
@@ -868,7 +868,7 @@ $utopia->get('/v1/oauth/:provider/redirect')
|
||||
;
|
||||
|
||||
$response
|
||||
->addCookie(Auth::$cookieName, Auth::encodeSession($user->getUid(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == APP_PROTOCOL), true)
|
||||
->addCookie(Auth::$cookieName, Auth::encodeSession($user->getUid(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $request->getServer('REQUEST_SCHEME', 'https')), true)
|
||||
;
|
||||
|
||||
$response->redirect($state['success']);
|
||||
|
||||
@@ -18,6 +18,10 @@ $utopia->shutdown(function() use ($utopia, $response, $request, $layout, $versio
|
||||
$header = new View(__DIR__ . '/../views/console/comps/header.phtml');
|
||||
$footer = new View(__DIR__ . '/../views/console/comps/footer.phtml');
|
||||
|
||||
$footer
|
||||
->setParam('home', $request->getServer('_APP_HOME', ''))
|
||||
;
|
||||
|
||||
$layout
|
||||
->setParam('header', [$header])
|
||||
->setParam('footer', [$footer])
|
||||
@@ -54,10 +58,14 @@ $utopia->get('/error/:code')
|
||||
$utopia->get('/console')
|
||||
->label('permission', 'public')
|
||||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
->action(function() use ($layout, $request)
|
||||
{
|
||||
$page = new View(__DIR__ . '/../views/console/index.phtml');
|
||||
|
||||
$page
|
||||
->setParam('home', $request->getServer('_APP_HOME', ''))
|
||||
;
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.title'))
|
||||
->setParam('body', $page);
|
||||
|
||||
@@ -21,6 +21,7 @@ if(!empty($request->getQuery('version', ''))) {
|
||||
$layout
|
||||
->setParam('title', APP_NAME)
|
||||
->setParam('description', Locale::getText('general.description'))
|
||||
->setParam('protocol', $request->getServer('REQUEST_SCHEME', 'https'))
|
||||
->setParam('domain', $domain)
|
||||
->setParam('api', $request->getServer('_APP_APPWRITE_HOST_CLIENT'))
|
||||
->setParam('project', $request->getServer('_APP_APPWRITE_ID'))
|
||||
|
||||
@@ -598,7 +598,7 @@ $utopia->patch('/v1/teams/:teamId/memberships/:inviteId/status')
|
||||
->setParam('event', 'auth.join')
|
||||
;
|
||||
|
||||
$response->addCookie(Auth::$cookieName, Auth::encodeSession($user->getUid(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == APP_PROTOCOL), true);
|
||||
$response->addCookie(Auth::$cookieName, Auth::encodeSession($user->getUid(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $request->getServer('REQUEST_SCHEME', 'https')), true);
|
||||
|
||||
if($success) {
|
||||
$response->redirect($success);
|
||||
|
||||
@@ -18,7 +18,6 @@ use Utopia\Locale\Locale;
|
||||
use Utopia\Registry\Registry;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
|
||||
const APP_PROTOCOL = 'https';
|
||||
const APP_NAME = 'Appwrite';
|
||||
const APP_DOMAIN = 'appwrite.io';
|
||||
const APP_EMAIL_TEAM = 'team@' . APP_DOMAIN;
|
||||
|
||||
@@ -168,7 +168,7 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<input name="teamId" id="teamId" type="hidden" data-ls-bind="{{console-project.teamId}}">
|
||||
<input name="inviteId" id="inviteId" type="hidden" data-ls-bind="{{member.inviteId}}">
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
<input name="redirect" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
|
||||
<button class="reverse"><?php echo Locale::getText('console.settings.section.members.labels.resend'); ?></button>
|
||||
</form>
|
||||
@@ -202,7 +202,7 @@ use Utopia\Locale\Locale;
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" id="teamId" type="hidden" data-ls-bind="{{console-project.teamId}}">
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
<input name="redirect" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
|
||||
<label for="name"><?php echo Locale::getText('console.settings.section.members.labels.name'); ?> <small>(<?php echo Locale::getText('general.optional'); ?>)</small></label>
|
||||
<input name="name" id="name" type="text" autocomplete="name">
|
||||
|
||||
@@ -344,7 +344,7 @@ $providers = $this->getParam('providers', []);
|
||||
<p>To complete set up, add this OAuth redirect URI to your <?php echo ucfirst($provider); ?> app configuration.</p>
|
||||
|
||||
<div class="input-copy">
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="https://{{env.DOMAIN}}/v1/oauth/callback/<?php echo $provider; ?>/{{router.params.project}}" class="margin-bottom-no" />
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/v1/oauth/callback/<?php echo $provider; ?>/{{router.params.project}}" class="margin-bottom-no" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,8 +19,8 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<div class="text-danger margin-bottom-large" style="display: none;" data-ls-if="{{router.params.failure}} == 1"><?php echo $this->escape(Locale::getText('home.auth.join.failure')); ?></div>
|
||||
|
||||
<input name="success" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/console?company={{router.params.company}}">
|
||||
<input name="failure" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/join?failure=1&company={{router.params.company}}&inviteId={{router.params.inviteId}}&secret={{router.params.secret}}&userId={{router.params.userId}}">
|
||||
<input name="success" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/console?company={{router.params.company}}">
|
||||
<input name="failure" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/join?failure=1&company={{router.params.company}}&inviteId={{router.params.inviteId}}&secret={{router.params.secret}}&userId={{router.params.userId}}">
|
||||
|
||||
<div class=""
|
||||
data-service="companies.getPreview"
|
||||
|
||||
@@ -21,7 +21,7 @@ use Utopia\Locale\Locale;
|
||||
<label><?php echo $this->escape(Locale::getText('home.auth.recovery.labels.email')); ?></label>
|
||||
<input name="email" type="email" class="full-width" autocomplete="email" placeholder="me@example.com" required>
|
||||
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/recovery/reset" />
|
||||
<input name="redirect" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/recovery/reset" />
|
||||
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-sign-in"></i> <?php echo $this->escape(Locale::getText('home.auth.recovery.action')); ?></button>
|
||||
</form>
|
||||
|
||||
@@ -14,9 +14,9 @@ use Utopia\Locale\Locale;
|
||||
<p><?php echo $this->escape(Locale::getText('home.auth.signin.oauth.title')); ?></p>
|
||||
|
||||
<div>
|
||||
<a href="" data-general-oauth="facebook" data-success="https://{{env.DOMAIN}}/console" data-failure="https://{{env.DOMAIN}}/auth/signin?failure=2" class="button facebook fill margin-bottom"><i class="icon-facebook"></i> Connect with Facebook</a>
|
||||
<a href="" data-general-oauth="github" data-success="https://{{env.DOMAIN}}/console" data-failure="https://{{env.DOMAIN}}/auth/signin?failure=2" class="button github fill margin-bottom"><i class="icon-github-circled"></i> Connect with Github</a>
|
||||
<a href="" data-general-oauth="linkedin" data-success="https://{{env.DOMAIN}}/console" data-failure="https://{{env.DOMAIN}}/auth/signin?failure=2" class="button linkedin fill margin-bottom"><i class="icon-linkedin"></i> Connect with Linkedin</a>
|
||||
<a href="" data-general-oauth="facebook" data-success="{{env.PROTOCOL}}://{{env.DOMAIN}}/console" data-failure="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signin?failure=2" class="button facebook fill margin-bottom"><i class="icon-facebook"></i> Connect with Facebook</a>
|
||||
<a href="" data-general-oauth="github" data-success="{{env.PROTOCOL}}://{{env.DOMAIN}}/console" data-failure="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signin?failure=2" class="button github fill margin-bottom"><i class="icon-github-circled"></i> Connect with Github</a>
|
||||
<a href="" data-general-oauth="linkedin" data-success="{{env.PROTOCOL}}://{{env.DOMAIN}}/console" data-failure="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signin?failure=2" class="button linkedin fill margin-bottom"><i class="icon-linkedin"></i> Connect with Linkedin</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,8 +34,8 @@ use Utopia\Locale\Locale;
|
||||
data-failure-param-alert-text="<?php echo $this->escape(Locale::getText('home.auth.signin.failure')); ?>"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="success" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/signin?failure=1">
|
||||
<input name="success" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signin?failure=1">
|
||||
|
||||
<input name="email" type="email" class="full-width" autocomplete="email" placeholder="<?php echo $this->escape(Locale::getText('home.auth.signin.labels.email')); ?>" required>
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ use Utopia\Locale\Locale;
|
||||
data-failure-param-alert-text="<?php echo $this->escape(Locale::getText('home.auth.signup.failure')); ?>"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="success" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/signup?failure=1">
|
||||
<input name="success" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signup?failure=1">
|
||||
|
||||
<label><?php echo $this->escape(Locale::getText('home.auth.signup.labels.name')); ?></label>
|
||||
<input name="name" type="text" autocomplete="name" placeholder="" required>
|
||||
@@ -43,7 +43,7 @@ use Utopia\Locale\Locale;
|
||||
<?php echo $this->escape(Locale::getText('home.auth.signup.labels.agree')); ?><a href="/policy/terms" target="_blank"><?php echo $this->escape(Locale::getText('home.auth.signup.labels.terms')); ?></a><?php echo $this->escape(Locale::getText('home.auth.signup.labels.and')); ?><a href="/policy/privacy" target="_blank"><?php echo $this->escape(Locale::getText('home.auth.signup.labels.privacy')); ?></a>
|
||||
</div>
|
||||
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/confirm" />
|
||||
<input name="redirect" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/confirm" />
|
||||
|
||||
<button type="submit"><?php echo $this->escape(Locale::getText('home.auth.signup.labels.action')); ?></button>
|
||||
</form>
|
||||
@@ -52,9 +52,9 @@ use Utopia\Locale\Locale;
|
||||
<p><?php echo $this->escape(Locale::getText('home.auth.signin.oauth.title')); ?></p>
|
||||
|
||||
<div>
|
||||
<a href="" data-general-oauth="facebook" data-success="https://{{env.DOMAIN}}/console" data-failure="https://{{env.DOMAIN}}/auth/signin?failure=2" class="button facebook fill margin-bottom"><i class="icon-facebook"></i> Connect with Facebook</a>
|
||||
<a href="" data-general-oauth="github" data-success="https://{{env.DOMAIN}}/console" data-failure="https://{{env.DOMAIN}}/auth/signin?failure=2" class="button github fill margin-bottom"><i class="icon-github-circled"></i> Connect with Github</a>
|
||||
<a href="" data-general-oauth="linkedin" data-success="https://{{env.DOMAIN}}/console" data-failure="https://{{env.DOMAIN}}/auth/signin?failure=2" class="button linkedin fill margin-bottom"><i class="icon-linkedin"></i> Connect with Linkedin</a>
|
||||
<a href="" data-general-oauth="facebook" data-success="{{env.PROTOCOL}}://{{env.DOMAIN}}/console" data-failure="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signin?failure=2" class="button facebook fill margin-bottom"><i class="icon-facebook"></i> Connect with Facebook</a>
|
||||
<a href="" data-general-oauth="github" data-success="{{env.PROTOCOL}}://{{env.DOMAIN}}/console" data-failure="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signin?failure=2" class="button github fill margin-bottom"><i class="icon-github-circled"></i> Connect with Github</a>
|
||||
<a href="" data-general-oauth="linkedin" data-success="{{env.PROTOCOL}}://{{env.DOMAIN}}/console" data-failure="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/signin?failure=2" class="button linkedin fill margin-bottom"><i class="icon-linkedin"></i> Connect with Linkedin</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use Utopia\Locale\Locale;
|
||||
|
||||
$protocol = $this->getParam('protocol', '');
|
||||
$domain = $this->getParam('domain', '');
|
||||
$api = $this->getParam('api', '');
|
||||
$project = $this->getParam('project', '');
|
||||
@@ -33,7 +34,7 @@ $env = $this->getParam('env', '');
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="<?php echo $this->getParam('title', ''); ?>" />
|
||||
<meta property="og:description" content="<?php echo $this->getParam('description', ''); ?>" />
|
||||
<meta property="og:image" content="<?php echo APP_PROTOCOL;?>://<?php echo $domain; ?>/images/logo.png?v=1" />
|
||||
<meta property="og:image" content="<?php echo $protocol; ?>://<?php echo $domain; ?>/images/logo.png?v=1" />
|
||||
<script>
|
||||
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
@@ -46,6 +47,7 @@ $env = $this->getParam('env', '');
|
||||
var APP_ENV = {
|
||||
NAME: '<?php echo APP_NAME; ?>',
|
||||
VERSION: '<?php echo $version; ?>',
|
||||
PROTOCOL: '<?php echo $protocol; ?>',
|
||||
DOMAIN: '<?php echo $domain; ?>',
|
||||
API: '<?php echo $api; ?>/v1',
|
||||
PROJECT: '<?php echo $project; ?>',
|
||||
|
||||
Reference in New Issue
Block a user