-
-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Login Form No Longer Popping Up #1143
Comments
Hello
The code looks good to me
I believe the popup is opened only if the user is not logged in already
Check the network calls and see what the /services path returned. If your service says isLoggedIn is true then it is normal
…On Sep 3, 2021, 19:23, at 19:23, slip13420 ***@***.***> wrote:
So this is a weird one. Using the example of setting the page to
[Single Site
Mode](https://github.com/silexlabs/Silex/wiki/Single-site-mode), and
[Integrate Silex with your
infrastructure](https://github.com/silexlabs/Silex/wiki/Integrate-Silex-with-your-infrastructure),
I was able to have login-form.html pop-up sometimes. However it now
never pops up. Not sure what I'm doing wrong. If I however manually
browse to lgin-form.html, it redirects to
/ce/custom-service/login_callback fine and then I'm able to login to
the app. Index.js looks like this...
`'use strict';
var serveStatic = require('serve-static')
const path = require('path');
const { SilexServer, Config } = require('silex-website-builder');
const CustomProvider = require('./custom-hosting-provider');
const config = new Config();
// provide only our custom hosting to user when they want to publish
config.publisherOptions.skipHostingSelection = true;
config.publisherOptions.enableHostingUnifile = false;
// disable other services
config.ceOptions.enableSftp = false;
const silex = new SilexServer(config);
// add our custom service
const CustomService = require('./custom-service');
silex.unifile.use(new CustomService());
// add our custom hosting provider
silex.publishRouter.addHostingProvider(new
CustomProvider(silex.unifile))
// serve modified html
silex.app.use('/', serveStatic(path.resolve('./dist/')));
// define a form to get the user login and password
silex.app.use('/login-form.html', (req, res) => res.sendFile(__dirname
+ '/login-form.html'));
silex.start(function() {
console.log('server started');
});
`
Any help appreciated!
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#1143
|
Ok, thanks I'll have a look. The issue I don't understand though is if I load up in Incognito mode, I still get no login form. Being incognito would mean I'm for sure not logged in. I'll check the network calls. |
I'll add the custom service code as well to see if that helps.
|
Ok, after more testing the issue is it only pops up after you have logged in once. What I mean is if you go incognito or use a browser you haven't used before, you have to manually got to /login-form.html and login first. Then each subsequent load of the page brings up the login form popup correctly. Any ideas? |
Hi @slip13420
ok i think i understand the login popin is opened when the user click on your service in the file explorer (https://cloud-explorer.org/) and then when the file explorer opens up, it tries to reconnect to the last visited service and may open the popup again maybe what you need is to make sure the user is logged in before opening silex (maybe open another login page which redirects to silex?) or after silex has loaded (add a script to silex html page?) let me know if i can help |
also feel free to join the chat if it is easier (not sure) |
hello @slip13420 |
Sorry man, got hung up on a different project and had to put this one aside for a bit. Probably getting back to it in a week or so. |
no prob @slip13420 :) |
So this is a weird one. Using the example of setting the page to Single Site Mode, and Integrate Silex with your infrastructure, I was able to have login-form.html pop-up sometimes. However it now never pops up. Not sure what I'm doing wrong. If I however manually browse to lgin-form.html, it redirects to /ce/custom-service/login_callback fine and then I'm able to login to the app. Index.js looks like this...
Any help appreciated!
The text was updated successfully, but these errors were encountered: