diff --git a/resources/views/others/import.edge b/resources/views/others/import.edge index ca7cc6df..5e6031bd 100644 --- a/resources/views/others/import.edge +++ b/resources/views/others/import.edge @@ -2,6 +2,7 @@ @section('content')
+@if(connectWithFranz)

@@ -63,5 +64,27 @@

+@else +
+

+ Franz/Ferdi Import Unavailable +

+
+

Account import is disabled

+

+ This server does not have Franz/Ferdi account imports enabled. To use Ferdium with this server, please create a new account directly instead. +

+
+

+ If you are the server administrator and want to enable imports, set the CONNECT_WITH_FRANZ environment variable to true and restart the server. +

+
+ + Login to an existing account + +
+
+@endif @endsection diff --git a/start/routes/web.ts b/start/routes/web.ts index 308abec6..e0c80082 100644 --- a/start/routes/web.ts +++ b/start/routes/web.ts @@ -46,7 +46,10 @@ Route.group(() => { }).prefix('user'); // Franz/Ferdi account import - Route.get('import', ({ view }) => view.render('others/import')); + Route.get('import', ({ view }) => { + const { connectWithFranz } = require('../config/app'); + return view.render('others/import', { connectWithFranz: connectWithFranz !== 'false' }); + }); Route.post('import', 'UserController.import'); // 404 handler