Documentation for `login` action
Is the documentation for the
login
action perhaps incorrect? The API reference at /auth/username-and-pass#1-using-the-signup-and-login-actions shows that the function takes username: string
and password: string
, but the member exported from wasp/client/auth
shows that it takes data: { email: string; password: string }
Wasp version: 0.13.2Username & Password | Wasp
Wasp supports username & password authentication out of the box with login and signup flows. It provides you with the server-side implementation and the UI components for the client side.
![No description](https://cdn.answeroverflow.com/1263533738801762467/image.png)
2 Replies
Hi @JakeLoew. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The
login
action in Wasp can be used with both username and password or email and password, depending on the authentication method you are using.
If you are using the Username & Password (https://wasp-lang.dev/docs/auth/username-and-pass#login) authentication method, the login
action takes two arguments: username: string
and password: string
. Here is an example of how you can use it:
On the other hand, if you are using the Email authentication method, the login
action would take data: { email: string; password: string }
. This is suggested in a Github issue (https://github.com/wasp-lang/wasp/issues/1698) where it is proposed to merge the login
and signup
actions for both username
and email
auth methods into one template file. However, this change has not been implemented yet.
Please note that the actual implementation might differ based on the version of Wasp you are using and the specific authentication method you have chosen. Always refer to the official Wasp documentation for the most accurate and up-to-date information.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @JakeLoew, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?I see. Thank you.