Github Pages Not Letting Me Redirect - javascript

I am creating a little website for guests visiting my home.
Everybody's always asking 'What's the wifi?' - I am sick of that so I am creating a web page for this!
I have created a website page, it requests the user to input a password. I will tell my guest the password for that website page. They submit the password, and it redirects them to a page with my wifi's name and password.
So, I created a GitHub Page with the wifi details and then made the login page but whenever the user clicks the login button, they get returned the 405 Error.
I thought about this for a few hours and decided to not use Github Pages for the login page only. When they click login and it is the correct password, it redirects perfectly! Is this an issue with GitHub Pages or have I done something wrong? I feel like this is not articulate enough so I am happy to further explain if you wish to!

Related

Facebook Login Button with redirection

i recently started working on a project that it required a Facebook login button.
I have successfully set up the button apart from the part where I must redirect the user to my dashboard area which must only be accessible to registered users.
From my understanding I need to fill this field here in the developers facebook settings page
which will redirect the user to my dashboard. I am guessing that the redirection link must include a token which will login the user automatically in my dashboard. Am I right so far?
My concern is if that link can be accessed by anyone and if someone get their hands on it can use it to login to my app without registering.

Invalid user credentials: redirect user to another page or display a message?

I have created a login page using HTML and JS. It has a form and a submit button. When a user enters invalid credentials, an error message is displayed on same page (it is displayed below the form). However, Facebook, GMail, Hotmail, etc, redirect the user to another page if credentials are incorrect. Why do they choose that approach? Is it related to security? Thanks in advance.
It's primarily a matter of personal choice. If you are creating a single page app with angular or the likes, the cleanest (and my preferred) method is to do as you are and display the error message there. If you want the error to be more "meaty", a redirect serves your purpose. Usually displaying the error on the same page is sufficient though.

facebook js sdk. How do I login with facebook, without the user actually login into facebook?

I am new to stackoverflow, so I hope that I ask the question correctly.
For a website that I am working on, I have to implement login in using your facebook account. I have this working for the biggest part, since the user is able to login with using facebook and I'm able to retrieve the information I want.
But the problem is, whenever the user logs in with their facebook account, he automatically gets logged in into facebook itself. And whenever the user presses the log out button, facebook logs him out too. For the facebook login, I am using the javascript sdk from facebook.
This can be quit anoying for the user, since it must be possible for a random user to login my website using their facebook account, even when someone else is logged into facebook itself on the same computer.
So my question is: is it possible to login with facebook, without the user actually login into facebook, like just let facebook verify the account and send the requested information back? Using the facebook js sdk off course.
That is not possible. You cannot have 2 different Facebook sessions in one browser and you need to login to Facebook in order to login to your App.

Facebook api not passing user info to integrated site, if user already logged into facebook directly and try to login from integrated site

I am working on login with facebook into our site. I am using facebook js sdk for this. Now, if I clicked on fb login button (which is placed in our site), it opens a popup window asking for user name and password. If I login here by entering correct username and password, its logging in, after that, it gives the required info to me. so, I am passing that info into our site and logging the user. No issue in this flow. But, if user already logged into facebook directly by opening facebook.com from browser and opened our site in separate tab . Our site will also contains "login with facebook" button. So, when user clicks on this button, it opens a login window and closes immediately without giving any user info. I guess it is because, user already logged into facebook. But here also I need the logged in user info. How do I achieve this?
Please help me out.
Any help would be appreciable.

Facebook Logout from app without session (user app authorization)

I've been banging my head against a wall with this one for way too long now.
I have a page outside facebook, with a like-button. Because it should be on a public computer, we also need a visible logout-button. When "like" is clicked, the user is prompted for login credentials. If those are ok, the like-event goes through ok. The user then should be able to log out. Which doesn't work.
The like button is now an -element. When clicked, it creates an edge.create-event that I can catch nicely.
For Logout button, i've tried 2 options.
First one:
<fb:login-button autologoutlink="true"></fb:login-button>
problem with this is, the link stays as "login" even after the user has logged in through the like-link, even after page refresh.
and a plain button, that triggers
FB.logout(function(response) {
cout(response);
});
This returns an error "FB.logout() called without a session." this seems to be because the user hasn't authorized the application. So the application has no rights. Both logout-options work fine IF the user has authorized the application. Problem is, this is only asked when the "login"-button is clicked. In this use case it wouldn't make sense for the user to first login and then click like.
Any ideas how to get the logout to work without getting the app authorization from the user?
Or how to make "like"-button in a way that it will ask for the app authorization?
I don't think it is possible.
You can check if somebody is currently logged in to facebook but not your up, that's about the most you can do. If a user is not authorized your app then you can't do anything with their login session (or data).
I don't think you should worry about public computers though, it is facebook's problem after all, not yours. If a user checks "remember me" on a public computer during login then they most likely won't click your logout button either.

Categories

Resources