I have not Idea Please help me
I will try to make Login Authentication in CodeIgniter for multiple user its define role and its check on controller. But I want to make with helper.
Related
I'm trying to make a user logged in at back-end who is already a user of another website of mine. For now I'm able to fetch the user's data from previous website's database using an API and make user registration during the login process. Same time I want this user to be logged in when data is just inserted because now user is existing. I tried to reuse same method $this->processLogin(); but this method takes request function processLogin(Request $request) I can't feel passing email & pass to utilize this same method. I have tried guzzle self request with 3 parms 'email, password, _token' using POST request which didn't work. I don't want to exclude this route as well because it is being used for normal login. How can i make this user logged in right after inserting the required data? Please advise. Thanks in advance.
// if $id is your user that you want to login, then:
auth()->loginUsingId($id);
I am trying to use a API which has a postable address where you can verify if a customer's username/password is correct, if so it returns a user ID.
What would be the best way of handling this, I need to query that postable API from the login form on my Laravel website to see whether or not a username / password is validated.
How can I use Laravel's Middleware to store a USER ID and session securely?
How can I create a Laravel session to allow someone to login to my Laravel site using their WHMCS client login?
The API I am using is https://developers.whmcs.com/api-reference/validatelogin/
I am new to Laravel. I am using Laravel's auth controllers for login/register on my website. After login/register, it will redirect to a dashboard. This is fine.
The problem is when the user (not logged in) submits a particular form. The form submission will take the user to a protected page. The auth system will intercept this (if not logged in) and ask for the user to login and the user can sign in. But after the sign in it won't get redirected to the actual destination. Instead, it goes back to the previous page. I tried the redirectto->intended() way in the middleware. It still does not work.
Found the solution. Use HTTP session. I am not sure if this is the best method.
POST the form to a route which doesn't need authentication
Validate and store the form data in the session using the controller
Redirect to the protected route where the auth will intercept and ask the user to login
After successful login, redirect to the original destination page using return redirect()->intended('defaultPage');
Access the form data from session inside the blade view
I am not storing any sensitive data in session. I have no idea how secure this method is.
If you have any suggestions please post.
I am new to laravel. By default, Laravel uses the email field for authentication. If you would like to customize this, you may define a username method on your LoginController. However I want to authenticate users based on their registration number. How do I achieve this.
Is it possible to modify the Laravel App Authentication? like I want to show different forms per different login route, like If I have 2 different login routes for admin and user.
Admin login route, can access the admin dashboard
/app/system/login
User login route, can access only the user page
/app/system/user/login
I tried to do
php artisan route:list
and I see this
LoginController#login
LoginController#showLoginForm
but I don't know where to find them to modify those for my requirements. Any help, ideas please?
You can edit Auth Controller is in Http/Controllers/Auth/AuthController.php, functions get import from file Illuminate/Foundation/Auth/AuthenticatesUsers.php.
Read to documentation how create other auth.