Coder Social home page Coder Social logo

Comments (11)

michelterstege81 avatar michelterstege81 commented on June 14, 2024

wantsToAddDevice() returns false. I'm using the default view that comes with the package for the 2FA challenge.

wantsToAddDevice() checks for $this->request->filled('safe_device'), which is not in the request, since the view does not contain that field in the form.

Maybe this is just a documentation issue. I guess this only works when creating a custom view that uses a safe_device field.

from twofactor.

DarkGhostHunter avatar DarkGhostHunter commented on June 14, 2024

Indeed, wantsToAddDevice() checks if the request contains safe_device and is not empty.

It could be added to the view if the safe_devices config is true, and hide it when it's disabled. Since I'm hands full right now, not on top of my list, but you're welcome to make a PR.

from twofactor.

Waleedviews avatar Waleedviews commented on June 14, 2024

@DarkGhostHunter i have exactly the same issue, how could i turn it on? i have added safe_device as a checkbox and is showing as on when i click on checkbox however it still shows safe_devices as a null, may be i am doing something wrong.

from twofactor.

DarkGhostHunter avatar DarkGhostHunter commented on June 14, 2024

from twofactor.

Waleedviews avatar Waleedviews commented on June 14, 2024

@DarkGhostHunter could you please elaborate this?

from twofactor.

DarkGhostHunter avatar DarkGhostHunter commented on June 14, 2024

Publish the view and edit the form.

from twofactor.

Waleedviews avatar Waleedviews commented on June 14, 2024

i already publish the view called confirm.blade.php, i have edit the form

<input id="safe_device" type="checkbox" class="border border-gray-300 name="safe_device" />
<label for="safe_device"> I trust this device. Don't ask for codes for 14 days. </label>

but nothing happened, it doesn't store the safe_devices data.

from twofactor.

Waleedviews avatar Waleedviews commented on June 14, 2024

@DarkGhostHunter checking to see if you have any update on this? thank you.

from twofactor.

DarkGhostHunter avatar DarkGhostHunter commented on June 14, 2024

@DarkGhostHunter checking to see if you have any update on this? thank you.

Hands full. PR welcomed.

from twofactor.

AlexisSerneels avatar AlexisSerneels commented on June 14, 2024

Here is the correct code you need to use:

<input id="safe_device" type="checkbox" value="1" class="border border-gray-300" name="safe_device" />
                <label for="safe_device"> I trust this device. Don't ask for codes for 14 days. </label>

You were missing the value and the class attribute was not closed.

from twofactor.

Waleedviews avatar Waleedviews commented on June 14, 2024

@AlexisSerneels i try this and it doesn't work, i am sure there's some issue with the code, i haven't check the package code yet, is it working with you?

from twofactor.

Related Issues (20)

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.