Lemmy App Development

788 readers
1 users here now

A place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform.

On-Topic:

Off-Topic:

founded 2 years ago
MODERATORS
51
1
submitted 2 years ago* (last edited 2 years ago) by canpolat@programming.dev to c/lemmydev@lemm.ee
 
 

I'm working on a test bot to understand the API and I have a question about authentication and JWT validation.

As far as I can see, the way to authenticate is to call the /user/login endpoint with valid credentials which will return a JWT. All is good except the JWT payload. I see that it contains iat but nothing about expiry (exp).

Now, I wanted to use the JWT for multiple requests, but that's difficult if I cannot figure out when the token expires. What is the best way to be sure about the validity of a JWT before using it. Should I get a new JWT before every operation, is that the intended behavior? Or maybe I misunderstand the way authentication works with Lemmy?

Edit: I asked this on Lemmy Development channel a few days ago and apparently someone has created an issue in Github. So, perhaps this will be addressed in a later update.

52
 
 

Is there any Discord bot that can automatically post Lemmy threads to a channel? I would use webhooks to do so for Reddit for easy use with the server our subreddit had, but since moving to Lemmy and the API death, that doesn't work and now we need an equivalent for Lemmy. So, anybody know if any exist yet?

53
54
 
 

Hi all,

I've put together some code on on Val Town that easily allows auto-publishing videos on Youtube channels to a Lemmy community.

It's simple enough that hopefully anyone should be able to set it up, and Val Town has a free tier which should be enough for anyone to publish a few feeds for free. There's a "README" on top showing how it's used.

Anyway, let me know what you think! If you end up using it, I'd love to get some thoughts on how easy it was to set up etc.

55
 
 

The Limit property is just a number, but it is different for different API endpoints. I'd like to have a list of the different values so i can easily stay within the max for each endpoint. Are the values documented somewhere? From the official js-client docs site, not even a given endpoint documents its maximum.