Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Changes #1054

Merged
merged 7 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions backend/integrations/oauth/soth/sothic/sothic.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,10 @@ func updateSessionValue(session *session.Session, key, value string) error {
if err := gz.Close(); err != nil {
return err
}

encrypted, err := encrypter(b.String())
if err != nil {
return err
}

session.Set(key, encrypted)
return nil
}
2 changes: 1 addition & 1 deletion backend/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func Init(db *gorm.DB, stores *store.Stores, integrations integrations.Integrati

applicationURL := settings.Application.ApplicationURL()

msftProvider := msft.New(settings.Microsft.Key, fmt.Sprintf("%s/api/v1/auth/microsoftonline/callback", applicationURL), settings.Microsft.Tenant)
msftProvider := msft.New(settings.Microsft.Key, "myapp://auth/callback", settings.Microsft.Tenant)
googProvider := goog.New(settings.Google.Key, settings.Google.Secret, fmt.Sprintf("%s/api/v1/auth/google/callback", applicationURL))

authMiddleware := authMiddleware.New(
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@generatesac/lib",
"version": "0.0.179",
"version": "0.0.180",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions frontend/lib/src/api/base.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const API_BASE_URL = "http://127.0.0.1:8080/api/v1";
export const LOCAL_API_BASE_URL = "http://localhost:3000/api/v1";
export const PROD_API_BASE_URL = "https://studentactivitycalendar.xyz/api/v1";

// BaseAPI for the entire application:
export const baseApi = createApi({
baseQuery: fetchBaseQuery({
baseUrl: API_BASE_URL,
baseUrl: PROD_API_BASE_URL,
credentials: "include",
prepareHeaders: async (headers, { getState }) => {
// User slice existing must exist in all dependent apps:
Expand Down
2 changes: 1 addition & 1 deletion frontend/mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "sac-mobile",
"slug": "student-activity-calendar",
"version": "1.0.3",
"version": "1.0.4",
"orientation": "portrait",
"icon": "./src/assets/images/icon.png",
"scheme": "myapp",
Expand Down
2 changes: 1 addition & 1 deletion frontend/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@fortawesome/react-native-fontawesome": "^0.3.2",
"@generatesac/lib": "0.0.179",
"@generatesac/lib": "0.0.180",
"@gorhom/bottom-sheet": "^4.6.3",
"@hookform/resolvers": "^3.4.2",
"@react-native-async-storage/async-storage": "^1.23.1",
Expand Down
19 changes: 0 additions & 19 deletions frontend/mobile/src/app/auth/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import { Image, Linking, SafeAreaView } from 'react-native';

import { router } from 'expo-router';

import { authApi } from '@generatesac/lib';

import Loading from '@/src/assets/gif/loading.gif';
Expand Down Expand Up @@ -57,23 +55,6 @@ const WelcomePage = () => {
'Continue with Outlook'
)}
</Button>
<Button
variant="standardButton"
color="darkRed"
onPress={() => router.navigate('/auth/callback')}
>
{isLoading ? (
<Image
source={Loading}
style={{
width: 15,
height: 15
}}
/>
) : (
'View Callback'
)}
</Button>
</Box>
</GlobalLayout>
</SafeAreaView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ function convertNumToTime(num: number) {
let meridiem = num === 23 ? 'AM' : 'PM';
let minutes = num % 100;

if (num !== 0 && (num < 1000 || num > 2359)) {
if (num !== 0 && (num < 0 || num > 2359)) {
throw new Error('Invalid time');
}

time = time / 100;

if (num < 12) {
time += 12;
if (time < 12) {
meridiem = 'AM';
}
if (num > 12) {
if (time > 12) {
time -= 12;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const EventCardBig: React.FC<EventCardBigProps> = ({
return (
<Box>
<TouchableOpacity
onPress={() => router.navigate(`/event/${eventId}`)}
onPress={() => router.navigate(`/app/event/${eventId}`)}
>
<Box gap="xs">
<Image
Expand Down
8 changes: 4 additions & 4 deletions frontend/mobile/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,10 @@
humps "^2.0.1"
prop-types "^15.7.2"

"@generatesac/lib@0.0.179":
version "0.0.179"
resolved "https://registry.yarnpkg.com/@generatesac/lib/-/lib-0.0.179.tgz#48941b9f059bcfc5508291bfa86d2c1f7c03d3da"
integrity sha512-N44CToFq1EDAJKnulpvPRkAp8GmC5x/T4NVSx5jO1de3YAMJX7r9vg+99eLHDkhAc+jZPyEckAiQQCfpG+uEsA==
"@generatesac/lib@0.0.180":
version "0.0.180"
resolved "https://registry.yarnpkg.com/@generatesac/lib/-/lib-0.0.180.tgz#01a5866af05ccbd369e14faddb8acb2745b9fece"
integrity sha512-UxIBGebRwwHdNyX8CHMmMTbC6WwQMKbvzAtRGCZyMvkldasw+XdQ9+F+WzZyR6OF1Lp84VLJsF6UAIYLO1slVQ==
dependencies:
"@reduxjs/toolkit" "^2.2.3"
react "^18.2.0"
Expand Down
Loading