@mojtaba-rajabi
- Member Since
- Nov 25, 2024
- Lessons Completed
- 1
- Comments Contributed
- 4
- Hours Watched
- 0.15
Recent Activity
Here's what @mojtaba-rajabi has been up to this past year
-
Commented on post How To Make Your AdonisJS Authentication Login Case-Insensitive
export default class User extends compose(BaseModel, AuthFinder) { public static async findForAuth(identifier: any, value: any) { const field = /^\d+$/.test(value) ? 'phone' : 'username' const user= await User.query().where(field, value).first() if (!user) { π fill inertia errors.username prop and redirect back to login page } if(!user.isActive){ π fill inertia errors.username prop with user is inactive and redirect back to login page } return user }
Copied! -
Commented on post How To Make Your AdonisJS Authentication Login Case-Insensitive
hi . thanks for excellent tutorials!
i added a custom findForAuth to my user class. i want check user is active after find user and befor send for password checking. i need a way to return exception in inertia errors props with username key but not any success:
in class User -
Completed lesson Setting Up Tailwind CSS
-
Upvoted comment Anytime! Ah - then it'll be import app from '@adonisjs/core/...
-
Replied to So long as you're importing and using this service in a context...
thanks . i am using adonis 6 . '@ioc:Adonis/Core/Application' not exists. so what is the alternative?
-
Commented on post Static, Non-Static, & Singleton Services
thank for tutorial.
how can add app instance when new() a singleton?
i need a singleton class that must inject ApplicationService in its construsctor
class SocketioService { constructor(protected app: ApplicationService) { } } export default new SocketioService ( /* i need access app instance hereπ*/)
Copied! -
Account created Welcome to Adocasts, @mojtaba-rajabi!