Skip to content

Conversation

@danieldanielecki
Copy link
Member

Fixes #24

Pull Request Type

  • Bug fix (please link related issues if applicable)
  • New feature
  • Question update
  • Other

Summary

Introducing a requirement to sign in after 15 minutes of using our platform. This can be done by using Apple's SSO, Google's SSO, or Email OTP.

@danieldanielecki
Copy link
Member Author

  • Email OTP working ✅
  • Google SSO working ✅
  • Apple SSO needs to be added 🏗️

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

1 similar comment
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

@danieldanielecki
Copy link
Member Author

  • Email OTP working ✅
  • Google SSO working ✅
  • Apple SSO needs to be added 🏗️

Apple's SSO isn't possible to test on localhost due to missing an option to add such a URL in Apple Developer redirects (domains). It'll be needed to be tested on production on https://education.ditectrev.com/


1. Go to **Auth** → **Templates**
2. Customize the email templates for:
- Magic URL (email OTP)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check with Cursor if Magic URL's are interchengeably called Email OTP's

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 26fb366.

useEffect(() => {
const handleCallback = async () => {
try {
// Check if this is an OAuth callback
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question if we need it as we're handling SSO's

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need it for all 3 methods of authentication; Google SSO, Apple SSO, OTP Email
Screenshot 2025-09-18 at 18 02 01
Screenshot 2025-09-18 at 18 02 07

}
};

const signInWithEmail = async (email: string) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need signInWithEmail is we're not using passwords?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signInWithEmail renamed to sendEmailOTP in 26fb366 to avoid future confusions.

start_time: number;
end_time: number;
is_active: boolean;
device_fingerprint: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete device fingerprint logic leftovers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, actually, we're still logging this and creating it in getDeviceFingerprint. When users try a different browser, or incognito tab, then this behaves like a protection for us not to start the trial again.

const getUserIP = async (): Promise<string> => {
// Try multiple IP services for better reliability
const ipServices = [
"/api/get-ip", // Local API route first
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have it so can be removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed in 26fb366

// If all IP services fail, use a fallback
let fallbackId = localStorage.getItem("ip_fallback_id");
if (!fallbackId) {
// Use browser fingerprint + timestamp for uniqueness
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question if we need IP address if we have the options here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, when all IP address endpoints fail, we use it

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

1 similar comment
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

}
}

static async updateEmailSession(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this? It looks like a magic link leftover

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 26fb366; it was unused.

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-plant-0e80e5803-70.westeurope.5.azurestaticapps.net

@danieldanielecki danieldanielecki merged commit 61aa3ec into main Sep 19, 2025
2 checks passed
@danieldanielecki danieldanielecki deleted the feature/sso branch September 19, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Sign up/Sign in (SSO Authentication)

2 participants