Comments (4)
Hi!
I can't wait recover of this problem. So, I changed local deps as follows.
I'll waiting for cleared master release.
@moduledoc """
A very simple model for storing tokens generated by guardian.
"""
use Ecto.Schema
# @primary_key {:jti, :string, autogenerate: false }
# primary key setting was changed as follow.
@primary_key {:id, :binary_id, autogenerate: true}
@schema_name Keyword.get(Application.get_env(:guardian_db, GuardianDb), :schema_name) || "guardian_tokens"
@schema_prefix Keyword.get(Application.get_env(:guardian_db, GuardianDb), :prefix) || nil
import Ecto.Changeset
import Ecto.Query
schema @schema_name do
# jti field added for query in mongodb
field :jti, :string
field :typ, :string
field :aud, :string
field :iss, :string
field :sub, :string
field :exp, :integer
field :jwt, :string
field :claims, :map
timestamps
end
from guardian_db.
@dhonig a pull request that adds support is welcomed 😀
from guardian_db.
Since mongodb_ecto doesn't support timestamps in schema definition properly.
So, inserted_at, updated_at fields are not created in mongodb collection.
This issue is resolved with changing "use Ecto.Schema" to "use Ecto.Model"
You can reference this issue in here.
from guardian_db.
@kevinblade Thats really cool to know. We ended up chucking ecto on our project in favor of custom Mongo repositories. In our case we were not getting enough from Ecto to stay with it due to different factors. We wrote our own mongo guardian token store, which we will see if it can be opensourced for those not using ecto....
from guardian_db.
Related Issues (20)
- separated token schemes HOT 4
- hash of tokens HOT 2
- Revoking Token thats already been removed throws error rather than returning error HOT 1
- Dependency Update
- Changelog updates since 0.8 HOT 3
- How to add more columns to 'guardian_tokens' table? HOT 5
- Compatibility with Guardian 2.0 HOT 2
- Idea: Use gen server to avoid round-trip to database HOT 9
- Update ecto_sql(currently at 3.1.0) dependency to the latest version HOT 1
- Do not fix ecto version HOT 2
- Documentation: need to update migrations if using non-default table name
- Guardian DB Redis Repo HOT 11
- Ecto.StaleEntryError when using Guardian.DB.on_revoke HOT 8
- cut a new release? HOT 1
- Add a column to optionally store the jti of the refresh token used to generate an access token. HOT 2
- Publish new release HOT 1
- `Guardian.DB.Sweeper` incompatible with old worker API HOT 1
- function Guardian.DB.on_refresh/2 is undefined or private HOT 3
- guardian_db fails to compile with Ecto 3 rc (undefined function migrations_path/1) HOT 20
- how to use in two or more servers with login just one time? share pwd HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guardian_db.