Code Monkey home page Code Monkey logo

Comments (2)

hallowatcher avatar hallowatcher commented on August 11, 2024

If you need an example, I made a full custom implementation of an OAuth strategy for osu!.

In the method for returning a profile from the API, I want to return the full API user instead of the one that extends OAuth2Profile, which like mentioned has properties that I will never need.

image

So in this example, I just want to write return await request.json() instead of creating a new object.

from remix-auth-oauth2.

sergiodxa avatar sergiodxa commented on August 11, 2024

From the OAuth2Profile the only required field is the provider, the rest are optional meaning you can add only what you need. But if you need something that the OAuth2Profile uses it would be ideal to return it, for example use displayName for the username.

The reason the OAuth2Profile exists is to allow strategy authors to normalize the data, if you install any OAuth2-based strategy you know the profile has an array of emails for example.

But if you're extending the OAuth2Strategy locally in your project feel free to return anything you need.

from remix-auth-oauth2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.