Giter Club home page Giter Club logo

Comments (5)

bohwaz avatar bohwaz commented on September 3, 2024 1

Implemented, please test and report :)

from karadav.

bohwaz avatar bohwaz commented on September 3, 2024 1
TypeError
call_user_func(): Argument #1 ($callback) must be a valid callback, function "my_login" not found or invalid function name

It's because you put the my_login function in config.local.php which is in the KaraDAV namespace.

Fix it with: const AUTH_CALLBACK = 'KaraDAV\my_login';

KaraDAV\Users::login(): Return value must be of type ?stdClass, bool returned

Fixed thanks.

from karadav.

poVoq avatar poVoq commented on September 3, 2024

I am trying this now, but both my code and the function example returns an error like this:

TypeError
call_user_func(): Argument #1 ($callback) must be a valid callback, function "my_login" not found or invalid function name

This is when I directly uncomment the function in the config file. I guess that is not possible.

Edit: making it a static function breaks karadav completely ;)

from karadav.

poVoq avatar poVoq commented on September 3, 2024

Ok I can get it somewhat to work with the class option when I add a MyAuthClass.php into the /lib folder with the following content:

<?php
class MyAuthClass {
        static function login(string $user, string $password) {
                return ($user == 'me' && $password == 'secret');
        }
}

However this only works with the correct me && secret. If you enter anything wrong the following error shows:

TypeError
KaraDAV\Users::login(): Return value must be of type ?stdClass, bool returned

which refers to the return false; in /data/ssd/outmode/karadav/lib/KaraDAV/Users.php:170

Edit: this also works with my own auth code for Akkoma, but only if the correct user credentials are provided.

from karadav.

poVoq avatar poVoq commented on September 3, 2024

Seems all working now 👍 I shared my auth script for Akkoma here:

https://meta.akkoma.dev/t/webdav-cloud-storage/466/2

from karadav.

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.