NUXT App how to make pages accessable without login? - authentication

i'm new to NUXT 3 and i created a small app.
If i'm not logged in, the page always redirect to my start page.
An authenticated user can access the page and can see all subpages.
Now, i want to create a FAQ page and a registration page.
How can i avoid these pages from redirect?
This pages should also be visible without login.

Related

how to add login page to access flask_admin page

I need to make a login page to access my admin page how is that possible in a flask
I didn't find any resource on youtube about this, they just let the user do the normal login and use the current_user.is_authenticated to access the admin page
any tips from flask_security to let that happen

Blazor Server - Force user to sign out and re-direct to Login Page

I am using roles based authorization in my Blazor server app. When a user is viewing any component, something in the database could change behind the scenes.
I would want to force the user to be logged out and back in again if they navigated to any other components. (ie the state of their authentication has changed).
I've tried using the SignInManager.SignOutAsync() and NavigationManager.Navigate in app.razor to Sign out the user and Navigate to the Login page, but I find that the component they are trying to hit will still draw for a split second before it Navigates away. Is there a way to have the Navigation manager in the app.razor to immediately navigate away without letting the Page from drawing first.
do a client-side POST to a controller method containing SignInManager.SignOutAsync(), followed by NavigationManager.NavigateTo with forceLoad set to true to the Login page

expressJS rendering login bootstrap modal if action is not authenticated

I am writing an expressjs/ejs app which is using Twitter Bootstrap 3 for web pages. I have used Bootstrap Modal for login. I have included the modal in the header section so it is available for every webpage. However, if a user has not logged in, he needs to be authenticated before performing certain actions on the app. I am using a middleware function to determine whether a user is logged in, however if a user is not logged in, I need to redirect him to home page and initiate the login model directly. I am not sure how I can initiate the bootstrap modal from server side. Any thoughts?
I need to be able to do:
response.render('/home#loginModal');
That way user is directed to home page and is given a chance to login.

How can I get devise to go to use one page as root if the user is logging in but another when they are logging out?

I'm working on a Rails 3 application that uses devise for user authentication. I would like the user to only see the splash/signup page when they first visit the site but be sent to the login page if they log out or time out, as follows:
Splash page
Click on login link
Login page
Supply proper login credentials
User's dashboard
Click on logout link or user times out
Login page (not splash page)
Take a look in the devise wiki: How To: Change the redirect path after destroying a session i.e. signing out

Redirect to own site when user logs in via Facebook app

I am building an app with the functionality to publish
messages to users walls while specific actions runs on
my website.
What I have done is (briefly):
Registered my own app on Facebook
Added a login button on my website with permission
to publish:
Log in on Facebook
Downloaded facebook-php-sdk library
It is now I start having problems. I do not know how
to do what I want to do now.
What I want to do:
When a user logs on to facebook via my website. I want
a file on my site to be called, where I can update the
user's data in my own database as well.
Because that is not what the canvas url is meant to do? How it
is no, seems no file at all is called on my site when
I click on Login.
Since you are using the Facebook PHP-SDK you noticed that there are two options for the users to login:
Using the XFBML button, which will:
Open a login dialog (pop-up) asking for permissions..etc
When a successful authentication/authorization is complete the dialog will close, the auth.login event will be triggered and based on that the page will get reloaded window.location.reload();
The PHP in the top of the page will get into business and $session = $facebook->getSession(); will actually retrieve a session! $user = $facebook->getUser(); will retrieve the current user
Using the Login URL generated by the Library $loginUrl = $facebook->getLoginUrl(); this URL will get you through the same flow and if you noticed there's a next redirect_uri parameter which will redirect you back after a successful process to that URL (mainly the same URL you are at), where you can change that parameter if you like.
The canvas URL is the URL Facebook uses when it displays your application from within Facebook. You would use this functionality if you expect users to use your application while in Facebook itself.
When authenticating using Facebook's API (assuming graph API usage here), you provide a redirect_uri as part of the authentication URL. Once Facebook has authorized your application, it will redirect the user's web browser to the URI you specified. This URI can be any link you desire on your site. You should use the link as the determination of when the user is logged in successfully, e.g., https://mywebsite/facebook/loggedin.