Anvil: Web Apps with Nothing but Python Transcripts
Chapter: User management and authentication
Lecture: Adding the user service
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Well, here we are in our web app and we want to add some stuff to say register or login. Now, we've already added these event handlers
0:10
so if somebody clicks login here, or they click register or logout, we already have the placeholders
0:16
but we need to fill our promise here to do actually log them in, and as you just saw this all starts with these services.
0:23
There's actually a ton of services we could have. Data tables, users, emails, secrets, so on. We're going to start in this chapter with users.
0:33
Let's see how we might let them log in. Let's say, email and password, and I guess we could go ahead and checkoff Google as well, if we want.
0:39
We can allow visitors to register for the site we could enforce secure passwords can allow them to remember, lets say, up to a year, right?
0:50
That's pretty good. We don't need to confirm the email addresses although that's a possibility here, right
0:55
so we're going to also say the accounts can be used right away. So, that looks like it's all set up here and everything's good to go.
1:03
You can see down here, a couple of the things that we can configure in terms of what we're going to store about the users.
1:10
We'll talk more about this interface when we get to databases, but you can add other information
1:14
like we could have a boolean column, or something like that about whether a user is Pro. Okay, true or false?
1:23
Now, later we're going to let people buy a Pro subscription to our account, so let's go ahead and say that our users
1:29
are going to have this is Pro, and you can adjust this later. You're not committed to what you're doin' right here.
1:34
Alright, so it looks like our user service is set up and notice also that we have the Google API and data table service added.
1:42
Data tables because that's where our user data is going to go this is actually part of the data table service
1:47
and then when we checked the sign in with Google to make that work, we probably have to go and configure our API over here, right, things like this.
1:56
We're not going to do that for now, just leave it alone, right? We'll just login with username and password.
2:01
Okay, it looks like our user service is set up, and in fact all we have to start doing is calling from our code and we have full user support.