Code Monkey home page Code Monkey logo

Comments (6)

ahsankhatri avatar ahsankhatri commented on August 27, 2024 1

Assuming this issue has been resolved. Closing.

from wordpress-auth-driver-laravel.

ahsankhatri avatar ahsankhatri commented on August 27, 2024

If I read it correctly, its Wordpress Auth integration into LARAVEL project, not the other way round.

from wordpress-auth-driver-laravel.

MACscr avatar MACscr commented on August 27, 2024

@ahsankhatri it is use the wordpress auth information (its pulling that data from the WP database) to allow you to use that same auth information to login to your laravel project. I just find it odd that it only pulls the email/password and forces you to use the email address in WP versus the actual username in WP that it could easily use instead. Get what I mean?

from wordpress-auth-driver-laravel.

ahsankhatri avatar ahsankhatri commented on August 27, 2024

You can pass your field name as key in input array, So if you want to authenticate via username and password use following procedure:

Auth::guard('wordpress')->attempt([
    'user_login' => 'johnny',
    'user_pass' => 'quickbrownfox'
]);

from wordpress-auth-driver-laravel.

MACscr avatar MACscr commented on August 27, 2024

Ah, i see where the confusion is. I setup the guard as the default in auth.php so i can use it to simply work as the general auth system for the laravel project. So in config/auth.php, i have:

    'defaults' => [
        'guard' => 'wordpress',
        'passwords' => 'wordpress',
    ],

and then in a route, im using:

Route::get('/sync_series', 'SyncController@sync_series')->middleware('auth');

from wordpress-auth-driver-laravel.

ahsankhatri avatar ahsankhatri commented on August 27, 2024

Alright, for that you first need to publish config file via:

php artisan vendor:publish --provider="MrShan0\WordpressAuth\WordpressAuthServiceProvider"

And make changes in config/wordpress-auth.php wtih email_column to user_login

'email_column' => 'user_login',

Most importantly, make sure you've used <input name="email"> in your login page, that will override authentication criteria with user_login as specified in auth file. Because Laravel uses default field email for authentication.

from wordpress-auth-driver-laravel.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.