跳到主要内容

r/flask


I needed one feature for my SaaS. Six hours later... I had launched another SaaS.
I needed one feature for my SaaS. Six hours later... I had launched another SaaS.
Show and Tell
I needed one feature for my SaaS. Six hours later... I had launched another SaaS.

Yesterday morning, I was preparing a landing page for a special price offer on my SaaS, the AI Jingle Maker. I thought it would be nice to add a short video greeting in the top right corner of the page, to bring a bit more human touch and explain the details of the offer.

At first, the plan was simple: grab my phone, record a quick video, add it to the app with a circle mask. It would not have taken too long.

But I had a bit of time, so I decided to turn that very specific need into a full SaaS.

It was 12:00, and I had planned to send the newsletter before 16:00. So I had 4 hours to build the product and insert the JS snippet into the head of my promo page to greet visitors.

I finished in time.

Then I spent 2 extra hours making the app multi-tenant, creating the landing page, buying a domain, submitting it to Paddle for approval, fine-tuning a few features, and sharing the product with a couple of friends.
Paddle approval was fast, so I did not even have to keep the billing placeholder I had prepared.

6 hours after the initial idea, the product was live and the first users started signing up!

Then I closed my laptop and headed to Soho for a cabaret show.

Just another day in my AI-assisted development journey.

What a time to be alive!

Check out the final product (and don't hesitate to suggest additional features): https://www.floatingvideo.com


Advertisement: Move in without going offline. T-Mobile 5G Home Internet. Delivered same-day. Powered by DoorDash.
Move in without going offline. T-Mobile 5G Home Internet. Delivered same-day. Powered by DoorDash.
media poster


Can somebody suggest a simple, working code showing how to add GitHub authentication to a flask app with JWT-extended?
Can somebody suggest a simple, working code showing how to add GitHub authentication to a flask app with JWT-extended?
Ask r/Flask

I've already have a working app; Flask-Login is used for email authentication; Google Auth is added for Gmail authentication; both work perfectly.

Now, I'm trying to add a GitHub authentication and it seems to me I'm stuck forever. Whatever I do i hit the same problem: GitHub requires the redirection what causes losing cookies and as result; when the access token is expired, it never calls this code

u/jwt.expired_token_loader
def expired_token_callback(jwt_header, jwt_payload):
    request.data
    return default_expired_token_callback(jwt_header, jwt_payload)

My JS interceptor can't correctly handle the issue and doesn't call the corresponding code to refresh it.

Tried to use AI but the same result - just hit a wall. Google stupidly can't find any examples because it treats my query wrong (it thinks I'm looking for a code on GitHub completely ignoring that I need GitHub authentication example).

Please help!

UPDATE

Finally, found the issue. It turned out that I returned wrong url. Instead of creating a response with all the cookies, I returned the bare redirect - this is why the expored_token_loader was never hit, now I return this

def login_create_tokens_redirect(user_id, redirect_url):
    access_token = create_access_token(identity = user_id)
    refresh_token = create_refresh_token(identity = user_id)


    login_response = redirect(redirect_url)
    
    set_access_cookies(login_response, access_token)
    set_refresh_cookies(login_response, refresh_token)
    return login_response