This repository contains an example authentication server for SmartClock. It handles OAuth flows for both Google & Trakt.
- Clone the repository:
git clone https://github.com/smartclock-app/Auth.git- Navigate to the project directory:
cd Auth- Install dependencies:
bun install- Copy
.env.exampleto.envfile in the project root and fill in the variables - Start the authentication server:
bun start- The server will be running at the port from your
.env.
-
GET /google- Initiates Google OAuth. -
GET /google/callback- Callback endpoint for Google OAuth. -
GET /trakt- Initiates Trakt OAuth. -
GET /trakt/callback- Callback endpoint for Trakt OAuth.
This project is licensed under the MIT License. See the LICENSE file for details.
To authenticate using Google OAuth, follow these steps:
- Open your browser and go to
http://localhost:3000/google. - Login with your Google account.
- You will be redirected to
http://localhost:3000/google/callbackwith your tokens.
To authenticate using Trakt OAuth, follow these steps:
- Open your browser and go to
http://localhost:3000/trakt. - Login with your Trakt account.
- You will be redirected to
http://localhost:3000/trakt/callbackwith your tokens.
These tokens can then be used to authenticate further requests within the SmartClock project.