Comments (8)
I am able to reproduce it. We'll probably have a solution to you fast, hopefully by the end of the day :)
from magic.
The problem is that even though you can use an email as username(s), the system doesn't enforce this, to allow for having usernames being "public handles", for social media sites etc, where the username is publicly displayed, but the email is not publicly displayed. Hence, we need to separate the username and the email address. To provide an email to the system during registrations, you'll have to slightly modify your payload to the following.
{
"username": "[email protected]",
"password": "ThisIsAPassword@123",
"frontendUrl": "https://demo.com/verify",
"subject": "Welcome",
"extra": {
"name": "Test User",
"email": "[email protected]"
}
}
Notice - The added email
extra field ...
The above of course allows you to use a different value as usernames if you wish - But this is optional. If you want to enforce usernames being the same as email address, you're of course free to do this as you see fit in your own (frontend/middleware) logic ...
Out of curiosity, I assume you found the recipe of how to implement user registrations "somewhere" out there? Do you have a link to it? Such that we can edit its wording? The ability to separate usernames and email addresses is a fairly new addition to the core, and hence there might be documentation out there that doesn't reflect this behaviour ...
Please close the issue if this fixes it for you :)
from magic.
Give me some time and I'll come back to you on this one. What version of Magic are you using?
from magic.
The problem is that even though you can use an email as username(s), the system doesn't enforce this, to allow for having usernames being "public handles", for social media sites etc, where the username is publicly displayed, but the email is not publicly displayed. Hence, we need to separate the username and the email address. To provide an email to the system during registrations, you'll have to slightly modify your payload to the following.
{ "username": "[email protected]", "password": "ThisIsAPassword@123", "frontendUrl": "https://demo.com/verify", "subject": "Welcome", "extra": { "name": "Test User", "email": "[email protected]" } }Notice - The added
The above of course allows you to use a different value as usernames if you wish - But this is optional. If you want to enforce usernames being the same as email address, you're of course free to do this as you see fit in your own (frontend/middleware) logic ...
Out of curiosity, I assume you found the recipe of how to implement user registrations "somewhere" out there? Do you have a link to it? Such that we can edit its wording? The ability to separate usernames and email addresses is a fairly new addition to the core, and hence there might be documentation out there that doesn't reflect this behaviour ...
Please close the issue if this fixes it for you :)
https://docs.aista.com/tutorials/registering/
here is the link to the tutorial which i referred.
--
btw an offtopic question so i just tried registering a user using a basic react frontend but for some reason i'm facing CORS issue even though the docs stage that if no url is assigned in the magic config it defaults to allow all.
from magic.
just tried registering a user using a basic react frontend but for some reason i'm facing CORS
Ouch! It shouldn't have any CORS issues - But you can override the CORS accepted frontends in its frontends
declaration in the "Config" menu item ...
here is the link to the tutorial which i referred
Thank you, we'll edit it in accordance to how it actually is ... :)
from magic.
the problem still persists should i open a new issue ?
from magic.
the problem still persists should i open a new issue
Yes please, it makes things easier to track on a per issue basis ...
I'll close this guy ...
from magic.
I have updated the relevant documentation now - Thank you :)
from magic.
Related Issues (20)
- [wait] slots to wait for multiple [fork] invocations HOT 1
- Allow for invoking endpoints from Hyper IDE
- Group endpoints by module/component/folder name
- Eliminate usage of magic.http HOT 1
- Simplify magic.node.extensions
- Fix snippets
- Fix SQL CRUD menu item's UI
- Re-create all documentation YouTube videos
- Fix EndpointController's TransformToActionResult method
- Separate HTTP parts from magic.endpoint.executor and put into controller project
- Refactor dependency injection logic in magic.lambda.http
- Automatic conversion to and from different Content-Types in magic.lambda.http
- Decouple file system completely
- Question about API Specification HOT 5
- CORS issue on the frontend while trying to make a POST request. HOT 12
- CI feature: integrate pull request preview environments HOT 1
- Error with epochs HOT 8
- no read, no write access on downloaded files? HOT 8
- Capture leads and send email HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magic.