question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I was thinking about whether we should rework the repo. I have two suggestion in mind.

  1. Moving the source code to a TypeScript base. I would argue this is more maintainable and this would also help with intellisense in various IDE’s.

  2. This is more radical - Moving away from actions in data and instead use authmanagement/{action} . So a reset password would move from

{
    "action": "resetShortToken",
    "data": { ... }
}

To a more REST like approach with /authmanagement/reset This would make it work more like a REST API and as well as a standard feathers service.

I realize this would be breaking changes, but I think it would benefit the overall structure of calling the API

Let me know what you think, and if I should elaborate.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
fratzingercommented, Jan 7, 2022

first official typescript release:

npm i feathers-authentication-management@pre

also checkout https://feathers-a-m.netlify.app/ for the new docs made by @OnnoGabriel 🎉. The release aims to have no breaking changes at all. But it also has a lot of new things. Every action is now callable in three ways:

  1. old traditional way
  2. through a separate service like: app.use('auth-management/password-change', new PasswordChangeService(app))
  3. through custom methods: app.service('authManagement').passwordChange(...) (in preparation of feathers v5)

Option 2 and 3 also have a flattened data argument. Please see the comparison:

const { AuthenticationManagementService } = require('feathers-authentication-management');

app.use('auth-management', new AuthenticationManagementService(app, options));

app.service('auth-management').create({
  action: 'passwordChange',
  value: {
    user: identifyUser, // identify user, e.g. {email: 'a@a.com'}. See options.identifyUserProps.
    oldPassword, // old password for verification
    password, // new password
    notifierOptions: {}, // optional - an object passed to notifier function
  },
}
const { PasswordChangeService } = require('feathers-authentication-management');

app.use("auth-management/password-change", new PasswordChangeService(app, options));

app.service('auth-management/password-change').create({
  user: identifyUser, // identify user, e.g. {email: 'a@a.com'}. See options.identifyUserProps.
  oldPassword, // old password for verification
  password, // new password
  notifierOptions: {}, // optional - an object passed to notifier function
}

I think once we ship the pre-release as an official release, we can close this issue. What do you think? Is there anyone who’s willing to test out the new pre release?

1reaction
MohammedFaragallahcommented, Aug 20, 2020

@cantoute please see example

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rework: Fried, Jason, Heinemeier Hansson, David
David Heinemeier Hansson is the cofounder of Basecamp and NYT bestselling coauthor of REWORK and REMOTE. He's also the creator of the software...
Read more >
Rework Definition & Meaning - Merriam-Webster
verb ; to work again or anew: such as ; a · revise ; b · to reprocess (something, such as used material)...
Read more >
re:Work
re:Work is a collection of practices, research, and ideas from Google and others to help you put people first. Learn more about re:Work...
Read more >
New & Used Office Furniture Chicago | Rework Store
Visit Rework in Chicago for a wide selection of new and used office furniture for every room. Click or call today to speak...
Read more >
Rework Definition & Meaning - Dictionary.com
rework ; to work or form again: to rework gold. ; to revise or rewrite: to rework an essay. ; to process again...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found