Agrega el siguiente código a tu modelo luego de la definición del objeto auth
Append the following code to your model after the auth object is defined
Tanto el objeto auth como la función user están definidos por defecto en la aplicación de andamiaje.
Both the auth object and the user function are already defined in the scaffolding application.
Ahora edita el modelo de tu aplicación de web2py y coloca las siguientes líneas en alguna parte después de la definición del objeto auth
Now edit the model of your web2py application and place the following lines somewhere after the definition of the auth object
Ten en cuenta que si tu aplicación usa Auth (tratado en el próximo capítulo), el objeto auth incluirá su propio servicio de correo en auth.settings.mailer, por lo que puedes utilizar este último de la siguiente forma
Note, if your application uses Auth (discussed in the next chapter), the auth object will include its own mailer in auth.settings.mailer, so you can use that instead as follows
En este objeto auth personalizado, establece el campo uid como el identificador que usaste para representar tu servicio en las reglas de seguridad.
In this custom auth object, set the uid field to the identifier you used to represent your service in your Security Rules.
El objeto auth es altamente personalizable y puede manejar aspectos como verificación por email, confirmación de registro, CAPTCHA, y métodos alternativos de autenticación por medio de los plugin.
The auth object is highly customizable and can deal with email verification, registration approvals, CAPTCHA, and alternate login methods via plugins. Adding grids
Si no accedió ningún usuario, el currentUser también sea nulo si el objeto auth no terminó de inicializarse.
Note: currentUser might also be null because the auth object has not finished initializing.
El contenido del JWT se incluirá en el objeto auth de tus reglas de seguridad de Firebase Realtime Database y del objeto request.auth de tus reglas de seguridad de Firebase Storage cuando dicho cliente intenta leer o escribir datos.
Furthermore, the contents of the JWT will be available in the auth object in your Firebase Realtime Database Security Rules and the request.auth object in your Firebase Storage Security Rules.
Además, el contenido del JWT estará disponible en el objeto auth de tus reglas de seguridad de Firebase Realtime Database y en el objeto request.auth de tus reglas de seguridad de Cloud Storage.
Furthermore, the contents of the JWT will be available in the auth object in your Firebase Realtime Database Security Rules and the request.auth object in your Cloud Storage Security Rules.
En las apps, para conocer el estado de autenticación del usuario, te recomendamos configurar un observador en el objeto Auth.
In your apps, the recommended way to know the auth status of your user is to set an observer on the Auth object.
Cuando el objeto Auth termina de inicializarse y ya hay un usuario con sesión activa, o este mismo se ha redireccionado de un flujo de acceso de un proveedor de identidad.
The Auth object finishes initializing and a user was already signed in from a previous session, or has been redirected from an identity provider's sign-in flow
En tus apps, el método recomendado para conocer el estado de autenticación de tu usuario es configurar un observador en el objeto Auth: Puedes obtener la información básica de perfil del usuario a partir del objeto User.
In your apps, the recommended way to know the auth status of your user is to set an observer on the Auth object. You can then get the user's basic profile information from the User object.
La manera recomendada de obtener el usuario actual es Cuando usas un objeto de escucha, se garantiza que el objeto Auth no esté en un estado intermedio, como la inicialización, cuando obtengas el usuario actual.
By using a listener, you ensure that the Auth object isn't in an intermediate state-such as initialization-when you get the current user.