# Aanmelden en inloggen via aangepaste API - Werkt dit correct?

**URL:** <https://meta.discourse.org/t/sign-up-and-login-via-custom-api-will-it-work-properly/166912>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [11 oktober 2020 om 18:59 UTC](https://meta.discourse.org/t/sign-up-and-login-via-custom-api-will-it-work-properly/166912 "2020-10-11T18:59:20Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Brighiu\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stefan_brighiu_m/32/174499_2.png) [@Stefan\_Brighiu\_M](https://meta.discourse.org/u/Stefan_Brighiu_M)\
**Post date:** [11 oktober 2020 om 18:59 UTC](https://meta.discourse.org/t/sign-up-and-login-via-custom-api-will-it-work-properly/166912/1 "2020-10-11T18:59:20Z")

</div>

In our case, we have a need to just use Discourse as a backend only (+ more or less like a CMS).

I’ve exposed the routes for sign-up and log-in using:

> skip\_before\_action :redirect\_to\_login\_if\_required, raise: false  
> skip\_before\_action :verify\_authenticity\_token, raise: false

… and allowed the routes in api\_parameter\_allowed?. In the final version i will do a salt of some kind just to add a bit of security, but this is only a draft.

… and used the code below.

All I want to know is if I missed anything. In the future we will probably login with google, maybe apple, and this flow would allow me to not open a browser at all for the sign up with email and login with email flows.

---

_[View the full topic](https://meta.discourse.org/t/sign-up-and-login-via-custom-api-will-it-work-properly/166912)._
