0

Is there any quick and simple solution to provide JWT token authentication for Ember with Typescript enabled? Although this issue sounds like quite a routine, most modules and documentations refer to ~5 years old practices that are barely applicable today. They either don't work with modern Ember versions or not compatible with Typescript.

Ember-simple-auth also contains documentation (and probably functionality) for pure JS only. Some efforts to provide definitions and README for Typescript are pending for a few years already, and stuck in conflicts. Ember-simple-auth-token extension for JWT is likely incompatible with modern Ember and forked by enthusiasts to be upgraded, but also seem to be stuck. So it seems that unless you don't use Typescript for Ember or willing to locally revise these modules for yourself, these modules are useless. What I would like to find is a module that I would only need to install, follow a few steps from README and to have a minimum viable JWT solution ready to use. Is there any?

6
  • 1
    hello! what do you want to use the JWT for? general access to the app? or do you also need it to integrate with some data library? (and if so, which one?) Commented Mar 15, 2024 at 21:26
  • I use ember-simple-auth and ember-simple-auth-token as is out the box in an ember app using ember 5.5, embroider, ember-template-imports and typescript. It works fine. What problem are you running into? I use ember-simple-auth and ember-simple-auth-token as is out the box in an ember app using ember 5.5, embroider, ember-template-imports and typescript. It works fine. What problem are you running into? Commented Mar 15, 2024 at 22:05
  • @NullVoxPopuli I want to use JWT for users access to backend. Login page should send credentials to API, then token received and saved somewhere at user side, so to access API. In one word, for users to log in. Commented Mar 19, 2024 at 14:58
  • @LiamPotter I installed ember-simple-auth/ember-simple-auth-token, then I tried following README. The first thing I noticed is that README is about JavaScript only. No Typescript snippets there. So I started to search for something already existing for Typescript. Found something in "Issues", but it seems to be not complete, outdated or smth. No any video, no any useful readme. There are only some discussions leading to nowhere, like stuck or conflicting pull requests. So I was wondering, is it me doing something wrong or maybe there is no simple solution unless I wouldn't be using Typescript. Commented Mar 19, 2024 at 15:06
  • Can you add what you've tried so far to your question or a reproduction repo? atm, it's to know where things aren't working for you. For types, it looks like you need a .d.ts here: github.com/mainmatter/ember-simple-auth/pull/2514, or we can try to bother the maintainers of ember-simple-auth to see if they want to merge Commented Mar 19, 2024 at 21:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.