Comments (2)
The before_validation
will always be run before the before_create
so I'm puzzled why you're seeing any errors here. Do you have some examples of the exact error you're receiving?
Thanks!
from authie.
Hi @adamcooke. Thanks for getting back. I was able to reproduce the error mentioned in the title of the issue by faking a user-agent of 256 characters or more in Chrome developer tools and logging in to my app through an Authie::Session
.
before_validation
is indeed run before before_create
but in before_create
, when in a controller context, self.user_agent=
is invoked again, overriding what happens in the before_validation
callback.
If you are able to reproduce the problem, I suspect it can be resolved by changing the line in the before_create
from:
self.user_agent = controller.request.user_agent
to:
self.user_agent = controller.request.user_agent[0,255] if controller.request.user_agent.is_a? String
Am I missing something?
from authie.
Related Issues (13)
- Upgrade from version 2 to 3 instructions HOT 2
- Toggle Authie in certain controllers HOT 2
- Rails 6 + Zeitwerk name error HOT 1
- v3.3.0 release? HOT 2
- Using Authie in route middleware HOT 3
- User impersonation not returning to parent session
- Migration Error
- Error when using UUID
- Use bigint in migrations
- Typo in ReadMe
- SQL instead of ActiveRecord HOT 1
- What to do about default Rails session management? 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 authie.