Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Backend method to detect if a user's account has already been created #6947


User avatar
0
commondesk created

We have implemnted a new oauth login flow. We need to know if a users account has ALREADY been created, or if were logging in again after the account has been created.

We assume this must be possible with all of the tooling that is available.

Any hints on how we can detect this?

Thanks.


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @commondesk

    Currently there is no endpoint to do this by default. If you only need this in your method and want to use it internally, you can use UserManager to find the user with the username. If you need an endpoint, you can create a method on UserAppService and agian use the UserManager to detect users existance.

  • User Avatar
    0
    commondesk created

    We need a webservice that can be checked from javascript for this purpose.

    Are there any tutorials on how to add new swagger bases webservice for this purpose?

    Is this the correct place to add it?

  • User Avatar
    0
    commondesk created

    I cant find any documenation on how to extend swagger to provide a new method. WTF??

  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, assuming that by "extend swagger", you mean adding new endpoint.

    If so, you can refer to @ismcagdas 's suggestion

    If you need an endpoint, you can create a method on UserAppService and agian use the UserManager to detect users existance.

    for documentation on application service, you can refer to https://aspnetboilerplate.com/Pages/Documents/Application-Services

  • User Avatar
    0
    commondesk created

    Thanks for the clarification and the link.

    When i say "extend swagger" i should have said, "add a new REST webservice that can be called from javascript".

    So, it sounds that if I add a method to UserAppService.cs and the IUserAppService, it will automaticlly expose this as a REST Webservice?

    As far as the "Documentation" .

    Application Services are used to expose domain logic to the presentation layer.

    Translates to -- Add a new webservice -- Got it.