Coder Social home page Coder Social logo

laravel-token-auth's People

Contributors

m-thalmann avatar

Watchers

 avatar

laravel-token-auth's Issues

Migrations fail on MySQL "SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'abilities' can't have a default value"

Reported in: m-thalmann/Cookbook#6 by @neeooh

When running the migrations with MySQL the following exception is thrown:

SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'abilities' can't have a default value (Connection: mysql, SQL: create table `auth_tokens` (`id` bigint unsigned not null auto_increment primary key, `type` varchar(255) not null, `authenticatable_type` varchar(255) not null, `authenticatable_id` bigint unsigned not null, `group_id` int null, `name` varchar(255) null, `token` varchar(64) not null, `abilities` text not null default '[]', `revoked_at` timestamp null, `expires_at` timestamp null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

This is because the text column does not allow defining default values (this is allowed in SQLite).

Move to new philosophy of package

Currently this package allows to generate Refresh Tokens and Access Tokens, both of which are stored to the database. Since (most of the time) they are generated in pairs and one can't exist without the other, it would be better to just store the Refresh Tokens, whereas the Access Tokens have encoded the group-id and a signature for it (somewhat like JWT). There should also be possibilities to create "standalone" Access Tokens with special permissions and a more easy way to create new tokens / pairs.

ToDo

  • Distinguish between Token-Pair-Access-Tokens and "standalone" Access Tokens
  • Better / easier way to create new Tokens (-Pairs)
  • (Don't use static Methods, use a Facade instead)
  • More customization options for:
    • Retrieving of token from request
    • Setting/Retrieving user
    • Authenticating a request (even when no token is present)
    • ...
      ...

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.