DEV Community

FredAbod
FredAbod

Posted on

6

Authorization In Node.js, All You Need To Know

Liquid syntax error: 'raw' tag was never closed

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
πŸŽ₯ Audio/video file upload with real-time preview
πŸ—£οΈ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
πŸ“€ Export interview's subtitles in VTT format

Read full post

Top comments (2)

Collapse
 
joelbonetr profile image
JoelBonetR πŸ₯‡ β€’

Hi @fredabod , nice introduction to this topic.

Pointing out improvement points:

Assuming that the headers look like that:

Authorization: {
    token: 'myToken'
}
Enter fullscreen mode Exit fullscreen mode

I'd change

const token = req.headers.authorization.split(' ')[1];
Enter fullscreen mode Exit fullscreen mode

for

const { token } = req.headers.authorization;
Enter fullscreen mode Exit fullscreen mode

just to avoid runtime errors if something went wrong (e.g. Authorization being undefined) as well as for maintainability as you can know what it does by just reading at this while in the array hardcoded position implementation you can be wondering "what the heck does Authorization have?".

Also take a look at CORS and specially to the DB Salt concept so you get better security on this.

Hope it helps somehow, best regards 😁

Collapse
 
fredabod profile image
FredAbod β€’

This was really helpful. Thank you @joelbonetr

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video

πŸ‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Communityβ€”every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple β€œthank you” goes a long wayβ€”express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay