AUTHENTICATION / LESSON 02
Clerk Basics.
What Clerk is and how it handles sign up and log in for you

Loading the lesson…
Loading activities…
AUTHENTICATION / LESSON 02
What Clerk is and how it handles sign up and log in for you

Loading the lesson…
Loading activities…
Every app with users needs a way for people to sign up and log in. Clerk is the hosted option from the intro to this module... a service that runs that whole job for you.
Back in the What Is Authentication? lesson, we said authentication proves who someone is and authorization decides what they're allowed to do. Clerk handles the authentication part. Your app still handles authorization.
Clerk handles all of that login work for you. You add Clerk to your app, and right away you get this stuff.
So what actually happens when someone uses your Clerk-powered app? Let's walk through it.
Your app shows a signup form. Clerk provides that form, so it looks professional and it works right out of the box.
The user types in their email and picks a password. Clerk checks that the password is strong enough (sorry, "password123").
To make sure the email is real, Clerk emails a short verification code (or a link, if you switch that on in the dashboard). That's how it keeps fake signups out.
Typing in the code (or clicking the link) proves the user owns that email address. Now their account is active.
Clerk creates a "session," which is a secure way to remember that this user is logged in. From here your app can trust who they are.
The user types their email and password into the login form.
Clerk checks whether the password is correct. And it does that securely, without EVER storing the actual password.
If the password checks out, Clerk creates a session. The user is logged in.
Now your app can ask Clerk "who's the current user?" and get their info back. Pretty painless, right?